Skip to content

Commit

Permalink
clean code + more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
euZebe committed May 24, 2018
1 parent 9673ca6 commit 566bfeb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/molkky-vanilla-redux.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const { createStore } = require('redux');

/*
ACTIONS (and rather ACTION CREATORS)
ACTION : Object { type: xxx, [...otherAttributes] }
often generated by ACTION CREATORS
*/

/**
Expand Down Expand Up @@ -111,10 +112,10 @@ function rootReducer(previousState = {}, action) {
};

// FIXME: unpure reducer: state mutated => audience and referee won't see the action
previousState[player].score += fallenPins.length;
previousState[player].consecutiveFailures = 0;
previousState.fallenPins = fallenPins.length;
return previousState;
// previousState[player].score += fallenPins.length;
// previousState[player].consecutiveFailures = 0;
// previousState.fallenPins = fallenPins.length;
// return previousState;

// FIXME: unpure reducer: nested state mutated => player listener won't see the action
// FIXME: !! BobListener listens modifications on Bob's substate
Expand Down

0 comments on commit 566bfeb

Please sign in to comment.