Skip to content

Instantly share code, notes, and snippets.

@btg5679
Created July 18, 2017 00:43
Show Gist options
  • Save btg5679/8d32de6f850b68096c57549bddf51651 to your computer and use it in GitHub Desktop.
Save btg5679/8d32de6f850b68096c57549bddf51651 to your computer and use it in GitHub Desktop.
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