Open desm opened 5 years ago
If it helps, I've had success with the following setup that doesn't call REDUX_DEVTOOLS_EXTENSION directly:
import {applyMiddleware, compose, createStore} from "redux";
import myReducer from "./reducers/myReducer";
import {install} from "redux-loop";
import {default as installInvariant} from 'redux-immutable-state-invariant';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
export const store = createStore(
myReducer,
{},
composeEnhancers(
applyMiddleware(
installInvariant()),
install()));
@j1m-renwick I tried the approach you suggested, but I am still getting the window is not defined.
event - compiled successfully
ReferenceError: window is not defined
at eval (webpack-internal:///./src/redux/store/configureStore.dev.js:18:26)
I'm sorry for the late reply. You can close this issue if you'd like.
I use the following TypeScript code to setup Redux' middlewares: (Note: for dev purposes only)
I have found that I need to comment out the call to
__REDUX_DEVTOOLS_EXTENSION__(...)
in order forredux-immutable-state-invariant
to work properly, otherwise incorrect mutations are detected for everything. Perhaps a note could be added that the 2 middlewares/extensions are incompatible? Thanks.