Created
March 16, 2020 03:36
-
-
Save Gopikrishna19/3f68929d4b4625b9b9deccb87f71af1c to your computer and use it in GitHub Desktop.
seting up redux devtools
This file contains 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
import {applyMiddleware, createStore} from 'redux'; | |
import {State} from './state'; | |
import {composeWithDevTools} from 'redux-devtools-extension'; | |
import {createCheckedReducer} from 'redux-tcomb'; | |
import reducers from './reducers'; | |
import thunk from 'redux-thunk'; | |
const createStore = (reducer) => { | |
const checkedReducers = createCheckedReducer(reducer, State); | |
const middlewareStoreCreator = composeWithDevTools( | |
applyMiddleware(thunk) | |
)(createStore); | |
return middlewareStoreCreator(checkedReducers); | |
}; | |
export const getStore = () => create(reducers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment