import { autorun, createTransformer, toJS } from 'mobx'
import PaneState from './components/Pane/state'
import EditorTabState from './components/Tab/state'
import FileTreeState from './components/FileTree/state'
import SettingState from './components/Setting/state'
const store = {
  PaneState,
  EditorTabState,
  FileTreeState,
  SettingState,
}

const transform = createTransformer(store => ({
  PaneState: toJS(store.PaneState),
  EditorTabState: toJS(store.EditorTabState),
  FileTreeState: toJS(store.FileTreeState)
}))
autorun((_) => {
  const transformedStore = transform(store)
  console.log('[mobx store] ', transformedStore)
})

export default store
window.mobxStore = store

@@ -1,16 +1,34 @@
 import %7B
+ extendObservable,
  autorun
@@ -277,16 +277,62 @@
 /state'%0A
+import FileState from './commons/File/state'%0A%0A
 const st
@@ -407,10 +407,68 @@
 te,%0A
-%7D%0A
+  FileState,%0A%7D%0A%0AextendObservable(store, %7B%0A  debug: false,%0A%7D)
 %0Acon
@@ -640,13 +640,50 @@
 ate)
+,%0A  FileState: toJS(store.FileState)
 %0A%7D))%0A
+%0A
 auto
@@ -691,16 +691,38 @@
 un((
-_
 ) =%3E %7B%0A
+  if (store.debug) %7B%0A  
   co
@@ -761,16 +761,18 @@
 (store)%0A
+  
   consol
@@ -812,16 +812,20 @@
 dStore)%0A
+  %7D%0A
 %7D)%0A%0Aexpo

update mobxStore