This repository was archived by the owner on Nov 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Expand file tree Collapse file tree 1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change 33 *
44 */
55
6+ // import { getSnapshot, applySnapshot } from 'mobx-state-tree'
7+
68import AppStore from './AppStore'
79
810let appStore = null
@@ -12,25 +14,25 @@ const createRootStore = (isServer, langSetup) => {
1214}
1315
1416export function initAppStore ( isServer = false , langSetup ) {
15- let ret
16-
17- if ( isServer ) {
18- if ( appStore === null ) {
19- ret = createRootStore ( isServer , langSetup )
20- } else {
21- ret = appStore
22- }
23- } else {
24- if ( appStore === null ) {
25- appStore = createRootStore ( isServer , langSetup )
26- }
27- ret = appStore
17+ if ( appStore === null ) {
18+ appStore = createRootStore ( isServer , langSetup )
2819 }
29- return ret
30- }
31-
32- export function getStoreInstance ( ) {
3320 return appStore
3421}
3522
23+ export const other = false
3624// export default initAppStore
25+
26+ /*
27+ if (module.hot) {
28+ if (module.hot.data && module.hot.data.appStore) {
29+ console.log('applySnapshot appStore: ', appStore)
30+ console.log('applySnapshot: ', module.hot.data.appStore)
31+ // applySnapshot(appStore, module.hot.data.appStore)
32+ }
33+ module.hot.dispose(data => {
34+ console.log('dispose: data: ', getSnapshot(appStore))
35+ data.appStore = getSnapshot(appStore)
36+ })
37+ }
38+ */
You can’t perform that action at this time.
0 commit comments