redux-devtools
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -104,2 +104,4 @@ 'use strict'; | ||
if (liftedState === undefined) liftedState = initialLiftedState; | ||
var shouldRecomputeStates = true; | ||
var committedState = liftedState.committedState; | ||
@@ -139,2 +141,4 @@ var stagedActions = liftedState.stagedActions; | ||
currentStateIndex = liftedAction.index; | ||
// Optimization: we know the history has not changed. | ||
shouldRecomputeStates = false; | ||
break; | ||
@@ -155,4 +159,12 @@ case ActionTypes.SWEEP: | ||
} | ||
stagedActions = [].concat(stagedActions, [liftedAction.action]); | ||
timestamps = [].concat(timestamps, [liftedAction.timestamp]); | ||
// Optimization: we know that the past has not changed. | ||
shouldRecomputeStates = false; | ||
// Instead of recomputing the states, append the next one. | ||
var previousEntry = computedStates[computedStates.length - 1]; | ||
var nextEntry = computeNextEntry(reducer, liftedAction.action, previousEntry.state, previousEntry.error); | ||
computedStates = [].concat(computedStates, [nextEntry]); | ||
break; | ||
@@ -173,3 +185,5 @@ case ActionTypes.SET_MONITOR_STATE: | ||
computedStates = recomputeStates(reducer, committedState, stagedActions, skippedActions); | ||
if (shouldRecomputeStates) { | ||
computedStates = recomputeStates(reducer, committedState, stagedActions, skippedActions); | ||
} | ||
@@ -176,0 +190,0 @@ return { |
{ | ||
"name": "redux-devtools", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "Redux DevTools with hot reloading and time travel", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
75711
1910