remote-redux-devtools
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -6,14 +6,10 @@ 'use strict'; | ||
var _instrument = require('redux-devtools/lib/instrument'); | ||
var _reduxDevtoolsInstrument = require('redux-devtools-instrument'); | ||
var _instrument2 = _interopRequireDefault(_instrument); | ||
var _reduxDevtoolsInstrument2 = _interopRequireDefault(_reduxDevtoolsInstrument); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function configureStore(next) { | ||
var subscriber = arguments.length <= 1 || arguments[1] === undefined ? function () { | ||
return {}; | ||
} : arguments[1]; | ||
return (0, _instrument2.default)(subscriber)(next); | ||
function configureStore(next, subscriber, options) { | ||
return (0, _reduxDevtoolsInstrument2.default)(subscriber, options)(next); | ||
} |
@@ -36,3 +36,3 @@ 'use strict'; | ||
function relay(type, state, action, nextActionId) { | ||
function relay(type, state, action, nextActionId, isExcess) { | ||
if (filters && isFiltered(action)) return; | ||
@@ -47,2 +47,3 @@ setTimeout(function () { | ||
name: instanceName, | ||
isExcess: isExcess, | ||
init: shouldInit | ||
@@ -125,3 +126,3 @@ }; | ||
function handleChange(state, liftedState) { | ||
function handleChange(state, liftedState, maxAge) { | ||
var nextActionId = liftedState.nextActionId; | ||
@@ -134,3 +135,4 @@ var liftedAction = liftedState.actionsById[nextActionId - 1]; | ||
if (lastAction === 'JUMP_TO_STATE') return; | ||
relay('ACTION', state, liftedAction, nextActionId); | ||
var isExcess = maxAge && liftedState.stagedActionIds.length === maxAge; | ||
relay('ACTION', state, liftedAction, nextActionId, isExcess); | ||
} else { | ||
@@ -142,8 +144,9 @@ relay('STATE', filterStagedActions(liftedState)); | ||
function devTools(options) { | ||
var maxAge = options.maxAge || 30; | ||
return function (next) { | ||
return function (reducer, initialState) { | ||
store = (0, _configureStore2.default)(next, monitorReducer)(reducer, initialState); | ||
store = (0, _configureStore2.default)(next, monitorReducer, { maxAge: maxAge })(reducer, initialState); | ||
init(options); | ||
store.subscribe(function () { | ||
handleChange(store.getState(), store.liftedStore.getState()); | ||
handleChange(store.getState(), store.liftedStore.getState(), maxAge); | ||
}); | ||
@@ -150,0 +153,0 @@ return store; |
{ | ||
"name": "remote-redux-devtools", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Relay Redux actions to remote Redux DevTools.", | ||
@@ -56,5 +56,5 @@ "main": "lib/index.js", | ||
"querystring": "^0.2.0", | ||
"redux-devtools": "^3.1.1", | ||
"redux-devtools-instrument": "^1.0.0", | ||
"socketcluster-client": "^4.3.7" | ||
} | ||
} |
@@ -65,2 +65,3 @@ Remote Redux DevTools | ||
`filters` | Map of arrays named `whitelist` or `blacklist` to filter action types. | ||
`maxAge` | Number of maximum allowed actions to be stored on the history tree, the oldest actions are removed once maxAge is reached. Default is `30`. | ||
@@ -77,3 +78,3 @@ | ||
initialState, | ||
devTools({ hostname: 'localhost', port: 8000, name: 'Android app', filters: { blacklist: ['EFFECT_RESOLVED'] }}) | ||
devTools({ name: 'Android app', hostname: 'localhost', port: 8000, maxAge: 30, filters: { blacklist: ['EFFECT_RESOLVED'] }}) | ||
); | ||
@@ -80,0 +81,0 @@ } |
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
12054
95
- Removedredux-devtools@^3.1.1
- Removed@types/hoist-non-react-statics@3.3.5(transitive)
- Removed@types/prop-types@15.7.13(transitive)
- Removed@types/react@18.3.12(transitive)
- Removed@types/react-redux@7.1.34(transitive)
- Removedcsstype@3.1.3(transitive)
- Removedhoist-non-react-statics@3.3.2(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-is@16.13.117.0.2(transitive)
- Removedreact-redux@7.2.9(transitive)
- Removedredux-devtools@3.7.0(transitive)