File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
- import { applyMiddleware , createStore } from 'redux'
1
+ import { applyMiddleware , compose , createStore } from 'redux'
2
2
import { routerMiddleware } from 'react-router-redux'
3
3
import thunk from 'redux-thunk'
4
4
import makeRootReducer from './reducers'
@@ -10,12 +10,13 @@ export default (initialState = {}, history) => {
10
10
const middleware = [ thunk , routerMiddleware ( history ) ]
11
11
12
12
// ======================================================
13
- // Developer Tools
13
+ // Store Enhancers
14
14
// ======================================================
15
+ const enhancers = [ ]
15
16
if ( __DEBUG__ ) {
16
17
const devToolsExtension = window . devToolsExtension
17
18
if ( typeof devToolsExtension === 'function' ) {
18
- middleware . push ( devToolsExtension ( ) )
19
+ enhancers . push ( devToolsExtension ( ) )
19
20
}
20
21
}
21
22
@@ -25,7 +26,10 @@ export default (initialState = {}, history) => {
25
26
const store = createStore (
26
27
makeRootReducer ( ) ,
27
28
initialState ,
28
- applyMiddleware ( ...middleware )
29
+ compose (
30
+ applyMiddleware ( ...middleware ) ,
31
+ ...enhancers
32
+ )
29
33
)
30
34
store . asyncReducers = { }
31
35
You can’t perform that action at this time.
0 commit comments