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.9.1 to 1.9.2

16

lib/instrument.js

@@ -306,2 +306,6 @@ 'use strict';

// maxAge number can be changed dynamically
var maxAge = options.maxAge;
if (typeof maxAge === 'function') maxAge = maxAge(liftedAction);
if (/^@@redux\/(INIT|REPLACE)/.test(liftedAction.type)) {

@@ -321,7 +325,7 @@ if (options.shouldHotReload === false) {

if (options.maxAge && stagedActionIds.length > options.maxAge) {
if (maxAge && stagedActionIds.length > maxAge) {
// States must be recomputed before committing excess.
computedStates = recomputeStates(computedStates, minInvalidatedStateIndex, reducer, committedState, actionsById, stagedActionIds, skippedActionIds, options.shouldCatchErrors);
commitExcessActions(stagedActionIds.length - options.maxAge);
commitExcessActions(stagedActionIds.length - maxAge);

@@ -339,4 +343,4 @@ // Avoid double computation.

// Auto-commit as new actions come in.
if (options.maxAge && stagedActionIds.length === options.maxAge) {
commitExcessActions(1);
if (maxAge && stagedActionIds.length >= maxAge) {
commitExcessActions(stagedActionIds.length - maxAge + 1);
}

@@ -651,5 +655,3 @@

/* eslint-disable no-eq-null */
if (options.maxAge != null && options.maxAge < 2) {
/* eslint-enable */
if (typeof options.maxAge === 'number' && options.maxAge < 2) {
throw new Error('DevTools.instrument({ maxAge }) option, if specified, ' + 'may not be less than 2.');

@@ -656,0 +658,0 @@ }

{
"name": "redux-devtools-instrument",
"version": "1.9.1",
"version": "1.9.2",
"description": "Redux DevTools instrumentation",

@@ -5,0 +5,0 @@ "main": "lib/instrument.js",

@@ -47,3 +47,3 @@ Redux DevTools Instrumentation

- **options** *object*
- **maxAge** *number* - maximum allowed actions to be stored on the history tree, the oldest actions are removed once `maxAge` is reached.
- **maxAge** *number* or *function* - maximum allowed actions to be stored on the history tree, the oldest actions are removed once `maxAge` is reached. Can be generated dynamically with a function getting current action as argument.
- **shouldCatchErrors** *boolean* - if specified as `true`, whenever there's an exception in reducers, the monitors will show the error message, and next actions will not be dispatched.

@@ -50,0 +50,0 @@ - **shouldRecordChanges** *boolean* - if specified as `false`, it will not record the changes till `pauseRecording(false)` is dispatched. Default is `true`.

@@ -312,2 +312,6 @@ import difference from 'lodash/difference';

// maxAge number can be changed dynamically
let maxAge = options.maxAge;
if (typeof maxAge === 'function') maxAge = maxAge(liftedAction);
if (/^@@redux\/(INIT|REPLACE)/.test(liftedAction.type)) {

@@ -328,3 +332,3 @@ if (options.shouldHotReload === false) {

if (options.maxAge && stagedActionIds.length > options.maxAge) {
if (maxAge && stagedActionIds.length > maxAge) {
// States must be recomputed before committing excess.

@@ -342,3 +346,3 @@ computedStates = recomputeStates(

commitExcessActions(stagedActionIds.length - options.maxAge);
commitExcessActions(stagedActionIds.length - maxAge);

@@ -355,4 +359,4 @@ // Avoid double computation.

// Auto-commit as new actions come in.
if (options.maxAge && stagedActionIds.length === options.maxAge) {
commitExcessActions(1);
if (maxAge && stagedActionIds.length >= maxAge) {
commitExcessActions(stagedActionIds.length - maxAge + 1);
}

@@ -651,5 +655,3 @@

export default function instrument(monitorReducer = () => null, options = {}) {
/* eslint-disable no-eq-null */
if (options.maxAge != null && options.maxAge < 2) {
/* eslint-enable */
if (typeof options.maxAge === 'number' && options.maxAge < 2) {
throw new Error(

@@ -656,0 +658,0 @@ 'DevTools.instrument({ maxAge }) option, if specified, ' +

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