-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.es
39 lines (33 loc) · 842 Bytes
/
index.es
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { reducer, boundActionCreators as bac } from './store'
import { migrate } from './migrate'
import { loadPState } from './p-state'
import { LevelingRoot as reactClass } from './ui'
import {
admiralIdSelector,
} from './selectors'
import { globalSubscribe, globalUnsubscribe } from './observers'
const { getStore } = window
const windowMode = true
const pluginDidLoad = () => {
globalSubscribe()
setTimeout(() => {
// try normalizing plugin dir structure to one used in 2.0.0
migrate()
const pStateOrNull = loadPState()
bac.ready(pStateOrNull)
const admiralId = admiralIdSelector(getStore())
if (admiralId) {
bac.loadGoalTable(admiralId)
}
})
}
const pluginWillUnload = () => {
globalUnsubscribe()
}
export {
reducer,
pluginDidLoad,
pluginWillUnload,
reactClass,
windowMode,
}