Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe throw error when not provide extension’s options #310

Open
HairyRabbit opened this issue Feb 14, 2017 · 1 comment
Open

Maybe throw error when not provide extension’s options #310

HairyRabbit opened this issue Feb 14, 2017 · 1 comment

Comments

@HairyRabbit
Copy link

HairyRabbit commented Feb 14, 2017

Hi, see again, I use follow config for createStore, It's throw Uncaught TypeError: enhancer(...) is not a function

const composeEnhancers = process.env.NODE_ENV !== 'production'
  && typeof window === 'object'
  && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
  // need become __REDUX_DEVTOOLS_EXTENSION_COMPOSE__({})
  ?  window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__()
  :  compose

Maybe provide a default value for options.

This is my browser console test:

version: 2.13.2

:)

@zalmoxisus
Copy link
Owner

zalmoxisus commented Feb 14, 2017

I know this is confusing, but the problem is not that it doesn't have a default value, but that window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__() (without arguments) is intended to act the same as window.__REDUX_DEVTOOLS_EXTENSION__() (which is a store enhancer, not a compose function, thus expects to get the reducer).

We could remove that, if it causes issues. I remember @jhen0409 was also confused about this not working without arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants