-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
For example when "Redux devtools" are not installed in the browser this code:
const enhancers = compose(
applyMiddleware(thunk),
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);
const store = createStore(
reducers,
/* preloadedState, */
enhancers,
);
crashes redux with Uncaught TypeError: Cannot read property 'apply' of undefined, because second argument to compose (second enhancer) is undefined.
What is the expected behavior?
Would be good if some enhancer is undefined not to crash, but to continue to operate as if this argument was not provided to compose.
(Not sure if this means the change of compose or the change of createStore)
Which versions of Redux, and which browser and OS are affected by this issue? Did this work in previous versions of Redux?
Redux version: 4.0.1
OS+Browser: Windows 10 + Chrome 75, Ubuntu 18 + Chrome 75, Windows 10 + IE