We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b919c51 commit 0d4acf7Copy full SHA for 0d4acf7
src/index.js
@@ -3,16 +3,14 @@ import isPlainObject from "lodash.isplainobject";
3
4
export default function reduxUnhandledAction(callback = defaultErrorHandler) {
5
return ({ getState }) => (next) => (action) => {
6
- if (isPlainObject(action)) {
7
- if (typeof action.type !== 'undefined') {
8
- const prevState = getState();
9
- const result = next(action);
10
- const nextState = getState();
11
- if (prevState === nextState) {
12
- callback(action);
13
- }
14
- return result;
+ if (isPlainObject(action) && typeof action.type !== "undefined") {
+ const prevState = getState();
+ const result = next(action);
+ const nextState = getState();
+ if (prevState === nextState) {
+ callback(action);
15
}
+ return result;
16
17
return next(action);
18
};
0 commit comments