fluxify it

This commit is contained in:
Peter Cottle 2015-08-29 08:45:53 -07:00
parent 78b87b3c47
commit de8d8221f5
4 changed files with 34 additions and 8 deletions

View file

@ -10,6 +10,7 @@ var ActionTypes = AppConstants.ActionTypes;
var _isAnimating = false;
var _flipTreeY = false;
var _numLevelsSolved = 0;
var GlobalStateStore = assign(
{},
@ -24,6 +25,10 @@ AppConstants.StoreSubscribePrototype,
return _flipTreeY;
},
getNumLevelsSolved: function() {
return _numLevelsSolved;
},
dispatchToken: AppDispatcher.register(function(payload) {
var action = payload.action;
var shouldInform = false;
@ -37,6 +42,10 @@ AppConstants.StoreSubscribePrototype,
_flipTreeY = action.flipTreeY;
shouldInform = true;
break;
case ActionTypes.LEVEL_SOLVED:
_numLevelsSolved++;
shouldInform = true;
break;
}
if (shouldInform) {