Redux thunk and asynchronous API calls
This commit is contained in:
parent
b556441459
commit
5ecf405fde
7 changed files with 64 additions and 2 deletions
|
@ -1,12 +1,13 @@
|
|||
import { createStore, applyMiddleware, compose } from 'redux'
|
||||
import rootReducer from '../reducers/index'
|
||||
import { forbiddenWordsMiddleware } from '../middleware'
|
||||
import thunk from 'redux-thunk'
|
||||
|
||||
const storeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
||||
|
||||
const store = createStore(
|
||||
rootReducer,
|
||||
storeEnhancers(applyMiddleware(forbiddenWordsMiddleware))
|
||||
storeEnhancers(applyMiddleware(forbiddenWordsMiddleware, thunk))
|
||||
)
|
||||
|
||||
export default store
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue