global state store

This commit is contained in:
Peter Cottle 2015-03-28 14:11:47 -07:00
parent 8493b51ec2
commit e03bdc619f
5 changed files with 95 additions and 12 deletions

View file

@ -2,9 +2,24 @@
var keyMirror = require('react/lib/keyMirror');
var CHANGE_EVENT = 'change';
module.exports = {
CHANGE_EVENT: CHANGE_EVENT,
StoreSubscribePrototype: {
subscribe: function(cb) {
this.on(CHANGE_EVENT, cb);
},
unsubscribe: function(cb) {
this.removeListener(CHANGE_EVENT, cb);
}
},
ActionTypes: keyMirror({
CHANGE_IS_ANIMATING: null,
SUBMIT_COMMAND: null,
CHANGE_LOCALE: null,
CHANGE_LOCALE_FROM_HEADER: null