Skip to content

Commit

Permalink
fix running next middlewares outside of transaction zone
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel.Majewski committed May 26, 2017
1 parent ad523db commit cd39dbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ export function transactionMiddleware<S>(api: MiddlewareAPI<S>): (next: Dispatch
throw 'IgnoreActionOnNotExistingTransaction';
}
}

return outsideZone.run<A>(() => next(action));
if (typeof action === 'function') {
return <A> next(action);
} else {
return outsideZone.run<A>(() => next(action));
}
};
};
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-tx",
"version": "0.2.5",
"version": "0.2.6",
"license": "MIT",
"description": "Optimistic Transactions for Redux",
"keywords": [
Expand Down

0 comments on commit cd39dbf

Please sign in to comment.