Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #36 from mpeyper/middleware-tests
Browse files Browse the repository at this point in the history
Added tests and documentation for redux-promise middleware
  • Loading branch information
jpeyper authored Aug 20, 2017
2 parents 1012466 + 91c42a3 commit 7508343
Show file tree
Hide file tree
Showing 10 changed files with 1,442 additions and 456 deletions.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* [Middleware](/docs/advanced/middleware/README.md)
* [redux-thunk](/docs/advanced/middleware/redux-thunk.md)
* [redux-saga](/docs/advanced/middleware/redux-saga.md)
* [redux-promise](/docs/advanced/middleware/redux-promise.md)
* [Custom Middleware](/docs/advanced/middleware/CustomMiddleware.md)
* [Examples](/docs/Examples.md)
* [API Reference](/docs/api/README.md)
Expand Down
1 change: 1 addition & 0 deletions docs/advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
* [Middleware](/docs/advanced/middleware/README.md)
* [redux-thunk](/docs/advanced/middleware/redux-thunk.md)
* [redux-saga](/docs/advanced/middleware/redux-saga.md)
* [redux-promise](/docs/advanced/middleware/redux-promise.md)
* [Custom Middleware](/docs/advanced/middleware/CustomMiddleware.md)
1 change: 1 addition & 0 deletions docs/advanced/middleware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ As previously stated, many Redux middlewares will just work with Redux Subspace,

* [redux-thunk](/docs/advanced/middleware/redux-thunk.md)
* [redux-saga](/docs/advanced/middleware/redux-saga.md)
* [redux-promise](/docs/advanced/middleware/redux-promise.md)

## Writing Custom Middleware

Expand Down
13 changes: 13 additions & 0 deletions docs/advanced/middleware/redux-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# redux-promise

The [`redux-promise` middleware](https://github.com/acdlite/redux-promise) works simply by using [Redux Subspaces `applyMiddleware` function](/docs/advanced/middleware/README.md).

```javascript
import { createStore } from 'redux'
import { applyMiddleware } from 'redux-subspace'
import promiseMiddleware from 'redux-promise'

const store = createStore(reducer, applyMiddleware(promiseMiddleware))
```

Now, the resulting actions when the promises resolve will be namespace correctly from the store they were dispatched from.
Loading

0 comments on commit 7508343

Please sign in to comment.