Skip to content

Commit

Permalink
Return error as payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Burtchaell committed Jul 13, 2015
1 parent 68146fc commit 1548a0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ export function myAsyncActionCreator() {
}
```

The middleware returns a [FSA compliant](https://github.com/acdlite/flux-standard-action) action for both rejected and resolved/fulfilled promises. In the case of a rejected promise, an `error` is returned.

---
Licensed MIT. Copyright 2015 Patrick Burtchaell.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redux-promise-middleware",
"version": "0.0.0",
"version": "0.0.1",
"description": "Redux middleware for handling promises",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function promiseMiddleware(next) {
type: FULFILLED
}),
error => next({
error,
payload: error,
type: REJECTED
})
);
Expand Down

0 comments on commit 1548a0d

Please sign in to comment.