Created
November 22, 2016 11:20
-
-
Save git-toni/b8a7b9bc218d91190f84bba3957c13ab to your computer and use it in GitHub Desktop.
mobx cyclic error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//StoreA.js | |
import importedB from './StoreB' | |
class StoreA{ | |
@observable fieldA | |
@computed get computedA(){ | |
return `I'm a ${this.fieldA} derived from ${importedB.computedB}` | |
} | |
} | |
class StoreB{ | |
@observable fieldB | |
@computed get computedB(){ | |
return require("some JSON file based on fieldB").items.importantOne | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment