MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / constructor

Method constructor

src/store/plugins/init-state.ts:11–24  ·  view source on GitHub ↗
(store: any)

Source from the content-addressed store, hash-verified

9 store: any;
10
11 constructor(store: any) {
12 this.store = store;
13 if (this.isMain) {
14 ipcMain.on(VUEX_INIT_EVENT_CONNECT, (event, arg) => {
15 event.reply(VUEX_INIT_EVENT_CONNECT, this.store.state);
16 });
17 } else {
18 ipcRenderer.send(VUEX_INIT_EVENT_CONNECT);
19 ipcRenderer.once(VUEX_INIT_EVENT_CONNECT, (event, state) => {
20 this.loadInitialState(state);
21 bus.at("initialized");
22 });
23 }
24 }
25
26 private loadInitialState(state: any) {
27 VueMerge(this.store.state, state);

Callers

nothing calls this directly

Calls 2

loadInitialStateMethod · 0.95
onMethod · 0.80

Tested by

no test coverage detected