redux-devtools
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -10,3 +10,4 @@ 'use strict'; | ||
function persistState(sessionId) { | ||
var deserializer = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
var stateDeserializer = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
var actionDeserializer = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; | ||
@@ -22,10 +23,7 @@ if (!sessionId) { | ||
function deserializeState(fullState) { | ||
if (!fullState || typeof deserializer !== 'function') { | ||
return fullState; | ||
} | ||
return _extends({}, fullState, { | ||
committedState: deserializer(fullState.committedState), | ||
committedState: stateDeserializer(fullState.committedState), | ||
computedStates: fullState.computedStates.map(function (computedState) { | ||
return _extends({}, computedState, { | ||
state: deserializer(computedState.state) | ||
state: stateDeserializer(computedState.state) | ||
}); | ||
@@ -36,2 +34,24 @@ }) | ||
function deserializeActions(fullState) { | ||
return _extends({}, fullState, { | ||
stagedActions: fullState.stagedActions.map(function (action) { | ||
return actionDeserializer(action); | ||
}) | ||
}); | ||
} | ||
function deserialize(fullState) { | ||
if (!fullState) { | ||
return fullState; | ||
} | ||
var deserializedState = fullState; | ||
if (typeof stateDeserializer === 'function') { | ||
deserializedState = deserializeState(deserializedState); | ||
} | ||
if (typeof actionDeserializer === 'function') { | ||
deserializedState = deserializeActions(deserializedState); | ||
} | ||
return deserializedState; | ||
} | ||
return function (next) { | ||
@@ -43,3 +63,3 @@ return function (reducer, initialState) { | ||
try { | ||
finalInitialState = deserializeState(JSON.parse(localStorage.getItem(key))) || initialState; | ||
finalInitialState = deserialize(JSON.parse(localStorage.getItem(key))) || initialState; | ||
next(reducer, initialState); | ||
@@ -46,0 +66,0 @@ } catch (e) { |
@@ -15,2 +15,4 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _react = require('react'); | ||
@@ -52,5 +54,9 @@ | ||
var DebugPanel = (function () { | ||
var DebugPanel = (function (_Component) { | ||
_inherits(DebugPanel, _Component); | ||
function DebugPanel() { | ||
_classCallCheck(this, DebugPanel); | ||
_Component.apply(this, arguments); | ||
} | ||
@@ -85,4 +91,4 @@ | ||
return DebugPanel; | ||
})(); | ||
})(_react.Component); | ||
exports['default'] = DebugPanel; |
@@ -15,2 +15,4 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _react = require('react'); | ||
@@ -61,6 +63,9 @@ | ||
var LogMonitor = (function () { | ||
function LogMonitor() { | ||
var LogMonitor = (function (_Component) { | ||
_inherits(LogMonitor, _Component); | ||
function LogMonitor(props) { | ||
_classCallCheck(this, LogMonitor); | ||
_Component.call(this, props); | ||
if (typeof window !== 'undefined') { | ||
@@ -257,5 +262,5 @@ window.addEventListener('keydown', this.handleKeyPress.bind(this)); | ||
return LogMonitor; | ||
})(); | ||
})(_react.Component); | ||
exports['default'] = LogMonitor; | ||
module.exports = exports['default']; |
@@ -13,2 +13,4 @@ 'use strict'; | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _react = require('react'); | ||
@@ -36,5 +38,9 @@ | ||
var LogMonitorEntry = (function () { | ||
var LogMonitorEntry = (function (_Component) { | ||
_inherits(LogMonitorEntry, _Component); | ||
function LogMonitorEntry() { | ||
_classCallCheck(this, LogMonitorEntry); | ||
_Component.apply(this, arguments); | ||
} | ||
@@ -123,5 +129,5 @@ | ||
return LogMonitorEntry; | ||
})(); | ||
})(_react.Component); | ||
exports['default'] = LogMonitorEntry; | ||
module.exports = exports['default']; |
{ | ||
"name": "redux-devtools", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Redux DevTools with hot reloading and time travel", | ||
@@ -50,3 +50,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"react-json-tree": "^0.1.3", | ||
"react-json-tree": "^0.1.8", | ||
"react-mixin": "^1.7.0", | ||
@@ -53,0 +53,0 @@ "react-redux": "^2.0.0", |
@@ -44,3 +44,3 @@ Redux DevTools | ||
// Enables your middleware: | ||
applyMiddleware(thunk), | ||
applyMiddleware(m1, m2, m3), // any Redux middleware, e.g. redux-thunk | ||
// Provides support for DevTools: | ||
@@ -47,0 +47,0 @@ devTools(), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74117
1893
Updatedreact-json-tree@^0.1.8