Skip to content

Instantly share code, notes, and snippets.

@git-toni
Created November 22, 2016 11:20
Show Gist options
  • Save git-toni/b8a7b9bc218d91190f84bba3957c13ab to your computer and use it in GitHub Desktop.
Save git-toni/b8a7b9bc218d91190f84bba3957c13ab to your computer and use it in GitHub Desktop.
mobx cyclic error
//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