New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-toolkit - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

11

lib/debugMiddleware.js

@@ -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;
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc