Skip to content

Instantly share code, notes, and snippets.

@cassiozen
Last active August 29, 2015 14:20
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 cassiozen/9d7a211fd7db628f4f3b to your computer and use it in GitHub Desktop.
Save cassiozen/9d7a211fd7db628f4f3b to your computer and use it in GitHub Desktop.
var TodoStore = assign({}, EventEmitter.prototype, {
/*
* These aren't really necessary:
*
addChangeListener: function(callback) {
this.on(CHANGE_EVENT, callback);
},
removeChangeListener: function(callback) {
this.removeListener(CHANGE_EVENT, callback);
}
*/
emitChange: function() {
// Instead of having the change string on a local constant,
// you can place on your app's constants module.
// this.emit(CHANGE_EVENT);
this.emit(StoreConstants.CHANGE);
},
});
module.exports = TodoStore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment