don't delete @@INIT

This commit is contained in:
echenley 2016-02-04 20:00:42 -06:00
parent f0e1efdcc2
commit 9bafa7a0d7

View File

@ -236,10 +236,10 @@ function liftReducerWith(reducer, initialCommittedState, monitorReducer, options
} }
case ActionTypes.PERFORM_ACTION: { case ActionTypes.PERFORM_ACTION: {
if (options.maxAge && stagedActionIds.length === options.maxAge) { if (options.maxAge && stagedActionIds.length === options.maxAge) {
// If maxAge has been reached, remove oldest action // If maxAge has been reached, remove oldest action.
delete actionsById[stagedActionIds[0]]; delete actionsById[stagedActionIds[1]];
skippedActionIds = skippedActionIds.filter(id => id !== stagedActionIds[0]); skippedActionIds = skippedActionIds.filter(id => id !== stagedActionIds[0]);
stagedActionIds = stagedActionIds.slice(1); stagedActionIds = [0].concat(stagedActionIds.slice(2));
committedState = computedStates[1].state; committedState = computedStates[1].state;
computedStates = computedStates.slice(1); computedStates = computedStates.slice(1);
} }