Skip to content

Instantly share code, notes, and snippets.

@goatslacker
Created December 20, 2014 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goatslacker/09816e639301747f9ba2 to your computer and use it in GitHub Desktop.
Save goatslacker/09816e639301747f9ba2 to your computer and use it in GitHub Desktop.
var { Store, Dispatcher } = require('./dist/emf')
var myDispatcher = new Dispatcher()
class DogStore extends Store {
getInitialState() {
return {
dog: 2
}
}
onAddDogAction(payload) {
this.state.dog = 4
this.emitChange();
}
}
var dogStore = new DogStore(myDispatcher)
dogStore.state.dog = 7
console.log(dogStore.state.dog) // == 7 :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment