redux-toolkit
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -20,3 +20,4 @@ 'use strict'; | ||
// 打印触发的action | ||
function logMiddleware(_ref) { | ||
exports['default'] = function (_ref) { | ||
var getState = _ref.getState; | ||
@@ -26,12 +27,10 @@ | ||
return function (action) { | ||
(0, _invariant2['default'])((0, _fluxStandardAction.isFSA)(action), 'action don\'t match FSA:\n' + action.toString()); | ||
(0, _debug2['default'])('state: old')(getState()); | ||
(0, _invariant2['default'])((0, _fluxStandardAction.isFSA)(action), 'action don\'t match FSA:\n' + JSON.stringify(action)); | ||
(0, _debug2['default'])('action')(JSON.stringify(action)); | ||
next(action); | ||
(0, _debug2['default'])('state: new')(getState()); | ||
(0, _debug2['default'])('nextState')(getState()); | ||
}; | ||
}; | ||
} | ||
}; | ||
exports['default'] = logMiddleware; | ||
module.exports = exports['default']; |
{ | ||
"name": "redux-toolkit", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "supply useful utils for redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -151,2 +151,2 @@ # redux-toolkit | ||
* print the info of actions | ||
* print the old state before and after action dispatched | ||
* print the old state after action dispatched |
@@ -6,14 +6,11 @@ import debug from 'debug'; | ||
// 打印触发的action | ||
function logMiddleware({ getState }) { | ||
export default function({ getState }) { | ||
return function(next) { | ||
return function(action) { | ||
invariant(isFSA(action), `action don't match FSA:\n${action.toString()}`); | ||
debug('state: old')(getState()); | ||
invariant(isFSA(action), `action don't match FSA:\n${JSON.stringify(action)}`); | ||
debug('action')(JSON.stringify(action)); | ||
next(action); | ||
debug('state: new')(getState()); | ||
debug('nextState')(getState()); | ||
}; | ||
}; | ||
} | ||
export default logMiddleware; |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
10252
182
1