Created
July 18, 2017 00:43
-
-
Save btg5679/652c81ae27abacd10ff15380f9a481c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logger({ getState }) { | |
return (next) => (action) => { | |
console.log('will dispatch', action) | |
return returnValue | |
} | |
} | |
const initialState = {} | |
const enhancers = [] | |
const middleware = [ | |
logger, | |
thunk, | |
routerMiddleware(history) | |
] | |
const composedEnhancers = compose( | |
applyMiddleware(...middleware), | |
...enhancers | |
) | |
const store = createStore( | |
rootReducer, | |
initialState, | |
composedEnhancers | |
) | |
export default store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment