Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-devtools

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-devtools - npm Package Compare versions

Comparing version 3.0.0-alpha-4 to 3.0.0-alpha-7

lib/bindActionCreatorsDeep.js

15

lib/index.js

@@ -7,14 +7,13 @@ 'use strict';

var _devTools = require('./devTools');
var _instrument = require('./instrument');
exports['default'] = _interopRequire(_devTools);
exports.ActionCreators = _devTools.ActionCreators;
exports.ActionTypes = _devTools.ActionTypes;
exports.instrument = _interopRequire(_instrument);
exports.ActionTypes = _instrument.ActionTypes;
var _DevToolsProvider = require('./DevToolsProvider');
var _persistState = require('./persistState');
exports.DevToolsProvider = _interopRequire(_DevToolsProvider);
exports.persistState = _interopRequire(_persistState);
var _persistState = require('./persistState');
var _createDevTools = require('./createDevTools');
exports.persistState = _interopRequire(_persistState);
exports.createDevTools = _interopRequire(_createDevTools);

@@ -9,5 +9,11 @@ 'use strict';

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var identity = function identity(_) {
return _;
};
function persistState(sessionId) {
var stateDeserializer = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
var actionDeserializer = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2];
var deserializeState = arguments.length <= 1 || arguments[1] === undefined ? identity : arguments[1];
var deserializeAction = arguments.length <= 2 || arguments[2] === undefined ? identity : arguments[2];

@@ -22,17 +28,16 @@ if (!sessionId) {

function deserializeState(fullState) {
return _extends({}, fullState, {
committedState: stateDeserializer(fullState.committedState),
computedStates: fullState.computedStates.map(function (computedState) {
return _extends({}, computedState, {
state: stateDeserializer(computedState.state)
});
})
});
}
function deserialize(_ref) {
var historyState = _ref.historyState;
function deserializeActions(fullState) {
return _extends({}, fullState, {
stagedActions: fullState.stagedActions.map(function (action) {
return actionDeserializer(action);
var rest = _objectWithoutProperties(_ref, ['historyState']);
return _extends({}, rest, {
historyState: _extends({}, historyState, {
stagedActions: historyState.stagedActions.map(deserializeAction),
committedState: deserializeState(historyState.committedState),
computedStates: historyState.computedStates.map(function (computedState) {
return _extends({}, computedState, {
state: deserializeState(computedState.state)
});
})
})

@@ -42,16 +47,2 @@ });

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) {

@@ -63,4 +54,7 @@ return function (reducer, initialState) {

try {
finalInitialState = deserialize(JSON.parse(localStorage.getItem(key))) || initialState;
next(reducer, initialState);
var json = localStorage.getItem(key);
if (json) {
finalInitialState = deserialize(JSON.parse(json)) || initialState;
next(reducer, initialState);
}
} catch (e) {

@@ -67,0 +61,0 @@ console.warn('Could not read debug session from localStorage:', e);

{
"name": "redux-devtools",
"version": "3.0.0-alpha-4",
"version": "3.0.0-alpha-7",
"description": "Redux DevTools with hot reloading and time travel",

@@ -13,3 +13,3 @@ "main": "lib/index.js",

"test:cov": "babel-node ./node_modules/.bin/isparta cover ./node_modules/.bin/_mocha -- --recursive",
"prepublish": "npm run lint && npm run clean && npm run build"
"prepublish": "npm run lint && npm run test && npm run clean && npm run build"
},

@@ -16,0 +16,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc