Socket
Socket
Sign inDemoInstall

remote-redux-devtools

Package Overview
Dependencies
20
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.9 to 0.2.0

48

lib/devTools.js

@@ -30,2 +30,3 @@ 'use strict';

var isExcess = void 0;
var isMonitored = void 0;

@@ -51,2 +52,21 @@ function isFiltered(action) {

function filterStagedActions(state) {
if (!filters) return state;
var filteredStagedActionIds = [];
var filteredComputedStates = [];
state.stagedActionIds.forEach(function (id, idx) {
if (!isFiltered(state.actionsById[id])) {
filteredStagedActionIds.push(id);
filteredComputedStates.push(state.computedStates[idx]);
}
});
return _extends({}, state, {
stagedActionIds: filteredStagedActionIds,
computedStates: filteredComputedStates
});
}
function handleMessages(message) {

@@ -58,3 +78,3 @@ if (message.type === 'ACTION') {

} else if (message.type === 'UPDATE') {
relay('STATE', store.liftedStore.getState());
relay('STATE', filterStagedActions(store.liftedStore.getState()));
} else if (message.type === 'SYNC') {

@@ -66,2 +86,7 @@ if (socket.id && message.id !== socket.id) {

}
} else if (message.type === 'START') {
isMonitored = true;
} else if (message.type === 'STOP' || message.type === 'DISCONNECTED') {
isMonitored = false;
relay('STOP');
}

@@ -105,21 +130,2 @@ }

function filterStagedActions(state) {
if (!filters) return state;
var filteredStagedActionIds = [];
var filteredComputedStates = [];
state.stagedActionIds.forEach(function (id, idx) {
if (!isFiltered(state.actionsById[id])) {
filteredStagedActionIds.push(id);
filteredComputedStates.push(state.computedStates[idx]);
}
});
return _extends({}, state, {
stagedActionIds: filteredStagedActionIds,
computedStates: filteredComputedStates
});
}
function handleChange(state, liftedState, maxAge) {

@@ -147,3 +153,3 @@ var nextActionId = liftedState.nextActionId;

store.subscribe(function () {
handleChange(store.getState(), store.liftedStore.getState(), maxAge);
if (isMonitored) handleChange(store.getState(), store.liftedStore.getState(), maxAge);
});

@@ -150,0 +156,0 @@ return store;

{
"name": "remote-redux-devtools",
"version": "0.1.9",
"version": "0.2.0",
"description": "Relay Redux actions to remote Redux DevTools.",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc