https://github.com/articulate/redux-future2
Future middleware for redux
https://github.com/articulate/redux-future2
async future middleware redux redux-middleware task
Last synced: over 1 year ago
JSON representation
Future middleware for redux
- Host: GitHub
- URL: https://github.com/articulate/redux-future2
- Owner: articulate
- License: mit
- Created: 2018-07-13T04:01:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-04T14:34:27.000Z (over 6 years ago)
- Last Synced: 2024-04-25T11:02:08.323Z (about 2 years ago)
- Topics: async, future, middleware, redux, redux-middleware, task
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 1
- Watchers: 56
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redux-future2
[](https://www.npmjs.com/package/redux-future2)
[](https://www.npmjs.com/package/redux-future2)
[](https://travis-ci.org/articulate/redux-future2)
[](https://coveralls.io/github/articulate/redux-future2?branch=master)
[](https://nodesecurity.io/orgs/articulate/projects/94556299-8383-47c3-83a6-1add64143199)
Future middleware for redux.
### Usage
```haskell
future : Store -> Function -> Action -> a
```
Redux middleware to dispatch actions that are Futures, also known as Asyncs or Tasks. Popular libraries providing Future implementations include [`crocks`](https://github.com/evilsoft/crocks) and [`Fluture`](https://github.com/fluture-js/Fluture) up to v11.
If any action has a property called `fork` that is a function, the action is assumed to be a Future.
```js
const { applyMiddleware, combineReducers, createStore } = require('redux')
const future = require('redux-future2')
const reducers = require('../ducks')
const store = createStore(combineReducers(reducers), applyMiddleware(future))
```