Redux thunk and asynchronous API calls

This commit is contained in:
Rodrigo Pedroso 2019-06-19 17:08:53 -04:00
commit 5ecf405fde
7 changed files with 64 additions and 2 deletions

View file

@ -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