Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.

Commit 68e1245

Browse files
committed
feat(configureStore): add thunk middleware
1 parent a40d1ef commit 68e1245

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/shared/configureStore/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

22
import { applyMiddleware, combineReducers, compose, createStore } from 'redux'
33
import promiseMiddleware from 'redux-promise-middleware'
4+
import thunk from 'redux-thunk'
45

5-
export default (reducers) => (initalState = {}) => {
6+
export default (reducers = {}) => (initalState = {}) => {
67
const rootReducer = combineReducers(reducers)
7-
const middleware = [promiseMiddleware()]
8-
const store = compose(
8+
const middleware = [promiseMiddleware(), thunk]
9+
10+
return compose(
911
applyMiddleware(...middleware),
1012
__BROWSER__ ? window.devToolsExtension ? window.devToolsExtension() : (f) => f : (f) => f
1113
)(createStore)(rootReducer, initalState)
12-
13-
return store
1414
}

0 commit comments

Comments
 (0)