Last active
January 9, 2023 19:28
-
-
Save Rajatgms/39b2dcccd4d0349fa64311d44029ab2e to your computer and use it in GitHub Desktop.
createStore vs configureStore
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
// Redux STORE | |
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; | |
const prodMiddleware = [thunk, immutableStateInvariant, serializableStateInvariant]: | |
const devMiddleware = [thunk]; | |
const middleware = process.env.prod ? prodMiddleware : devMiddleware; | |
const enhancer = composeEnhancers(applyMiddleware(...middleware)); | |
const ReduxStore = createStore(rootReducer, enhancer); | |
// RTK STORE | |
const RTKStore = configureStore({reducer: rootReducer}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment