Created
April 27, 2016 21:35
-
-
Save tmcw/908c495e07e1cd768503d3a11ceb3be1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bookkeeping(state, action) { | |
// taking the last history item | |
var newHead = actualReducer( | |
state.getIn(['history', state.get('historyIndex')]), action) | |
return state | |
.set('historyIndex', state.get('historyIndex') + 1) | |
.update('history', history => history.push(newHead)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment