Skip to content

Commit 0d4acf7

Browse files
committed
replaced nested if statements with single line if statement.
1 parent b919c51 commit 0d4acf7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/index.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import isPlainObject from "lodash.isplainobject";
33

44
export default function reduxUnhandledAction(callback = defaultErrorHandler) {
55
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;
6+
if (isPlainObject(action) && typeof action.type !== "undefined") {
7+
const prevState = getState();
8+
const result = next(action);
9+
const nextState = getState();
10+
if (prevState === nextState) {
11+
callback(action);
1512
}
13+
return result;
1614
}
1715
return next(action);
1816
};

0 commit comments

Comments
 (0)