Skip to content

Commit

Permalink
Merge bb50774 into dacca9a
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarnet committed Aug 12, 2016
2 parents dacca9a + bb50774 commit 3f34cdd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build/loading_bar_middleware.js
Expand Up @@ -21,10 +21,10 @@ function loadingBarMiddleware() {
var dispatch = _ref.dispatch;
return function (next) {
return function (action) {
next(action);
var nextAction = next(action);

if (action.type === undefined) {
return;
return false;
}

var _promiseTypeSuffixes = _slicedToArray(promiseTypeSuffixes, 3);
Expand All @@ -43,6 +43,8 @@ function loadingBarMiddleware() {
} else if (!!action.type.match(isFulfilled) || !!action.type.match(isRejected)) {
dispatch((0, _loading_bar_ducks.hideLoading)());
}

return nextAction;
};
};
};
Expand Down
6 changes: 4 additions & 2 deletions src/loading_bar_middleware.js
Expand Up @@ -6,10 +6,10 @@ export default function loadingBarMiddleware(config = {}) {
const promiseTypeSuffixes = config.promiseTypeSuffixes || defaultTypeSuffixes

return ({ dispatch }) => next => action => {
next(action)
const nextAction = next(action)

if (action.type === undefined) {
return
return false
}

const [PENDING, FULFILLED, REJECTED] = promiseTypeSuffixes
Expand All @@ -24,5 +24,7 @@ export default function loadingBarMiddleware(config = {}) {
!!action.type.match(isRejected)) {
dispatch(hideLoading())
}

return nextAction
}
}

0 comments on commit 3f34cdd

Please sign in to comment.