Socket
Socket
Sign inDemoInstall

redux-devtools-instrument

Package Overview
Dependencies
2
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.3 to 1.9.0

86

lib/instrument.js

@@ -8,3 +8,3 @@ 'use strict';

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

@@ -82,3 +82,3 @@ exports.liftAction = liftAction;

setActionsActive: function setActionsActive(start, end) {
var active = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
var active = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

@@ -211,16 +211,14 @@ return { type: ActionTypes.SET_ACTIONS_ACTIVE, start: start, end: end, active: active };

return function (liftedState, liftedAction) {
var _ref = liftedState || initialLiftedState;
var _ref = liftedState || initialLiftedState,
monitorState = _ref.monitorState,
actionsById = _ref.actionsById,
nextActionId = _ref.nextActionId,
stagedActionIds = _ref.stagedActionIds,
skippedActionIds = _ref.skippedActionIds,
committedState = _ref.committedState,
currentStateIndex = _ref.currentStateIndex,
computedStates = _ref.computedStates,
isLocked = _ref.isLocked,
isPaused = _ref.isPaused;
var monitorState = _ref.monitorState;
var actionsById = _ref.actionsById;
var nextActionId = _ref.nextActionId;
var stagedActionIds = _ref.stagedActionIds;
var skippedActionIds = _ref.skippedActionIds;
var committedState = _ref.committedState;
var currentStateIndex = _ref.currentStateIndex;
var computedStates = _ref.computedStates;
var isLocked = _ref.isLocked;
var isPaused = _ref.isPaused;
if (!liftedState) {

@@ -306,3 +304,3 @@ // Prevent mutating initialLiftedState

if (liftedAction.type.indexOf('@@redux/INIT') === 0) {
if (/^@@redux\/(INIT|REPLACE)/.test(liftedAction.type)) {
if (options.shouldHotReload === false) {

@@ -393,21 +391,17 @@ actionsById = { 0: liftAction(INIT_ACTION) };

{
var _ret = function () {
// Toggle whether an action with given ID is skipped.
// Being skipped means it is a no-op during the computation.
var actionId = liftedAction.id;
// Toggle whether an action with given ID is skipped.
// Being skipped means it is a no-op during the computation.
var _actionId = liftedAction.id;
var index = skippedActionIds.indexOf(actionId);
if (index === -1) {
skippedActionIds = [actionId].concat(skippedActionIds);
} else {
skippedActionIds = skippedActionIds.filter(function (id) {
return id !== actionId;
});
}
// Optimization: we know history before this action hasn't changed
minInvalidatedStateIndex = stagedActionIds.indexOf(actionId);
return 'break';
}();
if (_ret === 'break') break;
var index = skippedActionIds.indexOf(_actionId);
if (index === -1) {
skippedActionIds = [_actionId].concat(skippedActionIds);
} else {
skippedActionIds = skippedActionIds.filter(function (id) {
return id !== _actionId;
});
}
// Optimization: we know history before this action hasn't changed
minInvalidatedStateIndex = stagedActionIds.indexOf(_actionId);
break;
}

@@ -418,5 +412,5 @@ case ActionTypes.SET_ACTIONS_ACTIVE:

// Being skipped means it is a no-op during the computation.
var start = liftedAction.start;
var end = liftedAction.end;
var active = liftedAction.active;
var start = liftedAction.start,
end = liftedAction.end,
active = liftedAction.active;

@@ -465,4 +459,4 @@ var actionIds = [];

// Recompute actions in a new order.
var _actionId = liftedAction.actionId;
var idx = stagedActionIds.indexOf(_actionId);
var _actionId2 = liftedAction.actionId;
var idx = stagedActionIds.indexOf(_actionId2);
// do nothing in case the action is already removed or trying to move the first action

@@ -481,7 +475,7 @@ if (idx < 1) break;

// move left
stagedActionIds = [].concat(stagedActionIds.slice(0, newIdx), [_actionId], stagedActionIds.slice(newIdx, idx), stagedActionIds.slice(idx + 1));
stagedActionIds = [].concat(stagedActionIds.slice(0, newIdx), [_actionId2], stagedActionIds.slice(newIdx, idx), stagedActionIds.slice(idx + 1));
minInvalidatedStateIndex = newIdx;
} else if (diff < 0) {
// move right
stagedActionIds = [].concat(stagedActionIds.slice(0, idx), stagedActionIds.slice(idx + 1, newIdx), [_actionId], stagedActionIds.slice(newIdx));
stagedActionIds = [].concat(stagedActionIds.slice(0, idx), stagedActionIds.slice(idx + 1, newIdx), [_actionId2], stagedActionIds.slice(newIdx));
minInvalidatedStateIndex = idx;

@@ -583,4 +577,4 @@ }

function unliftState(liftedState) {
var computedStates = liftedState.computedStates;
var currentStateIndex = liftedState.currentStateIndex;
var computedStates = liftedState.computedStates,
currentStateIndex = liftedState.currentStateIndex;
var state = computedStates[currentStateIndex].state;

@@ -647,6 +641,6 @@

function instrument() {
var monitorReducer = arguments.length <= 0 || arguments[0] === undefined ? function () {
var monitorReducer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {
return null;
} : arguments[0];
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
};
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -653,0 +647,0 @@ /* eslint-disable no-eq-null */

{
"name": "redux-devtools-instrument",
"version": "1.8.3",
"version": "1.9.0",
"description": "Redux DevTools instrumentation",

@@ -50,3 +50,3 @@ "main": "lib/instrument.js",

"mocha": "^2.2.5",
"redux": "^3.5.2",
"redux": "^4.0.0",
"rimraf": "^2.3.4",

@@ -53,0 +53,0 @@ "rxjs": "^5.0.0-beta.6",

@@ -309,3 +309,3 @@ import difference from 'lodash/difference';

if (liftedAction.type.indexOf('@@redux/INIT') === 0) {
if (/^@@redux\/(INIT|REPLACE)/.test(liftedAction.type)) {
if (options.shouldHotReload === false) {

@@ -312,0 +312,0 @@ actionsById = { 0: liftAction(INIT_ACTION) };

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc