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

Latest commit

 

History

History
13 lines (9 loc) · 544 Bytes

redux-promise.md

File metadata and controls

13 lines (9 loc) · 544 Bytes

redux-promise

The redux-promise middleware works simply by using Redux Subspace's applyMiddleware function.

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.