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

Add sanity check for accidentally passing two separate enhancers? #3114

Closed
markerikson opened this issue Aug 28, 2018 · 1 comment
Closed

Comments

@markerikson
Copy link
Contributor

markerikson commented Aug 28, 2018

I've occasionally seen people passing two separate store enhancers to createStore() (as seen in this SO question ). This is always an error, and it seems like we could add an additional sanity check to createStore() - probably just checking to see if we have 3 args, and if the second and third are both functions. (I would think we can safely assume that the preloadedState argument shouldn't be a function.) It's a rarer problem, but it's preventable.

Thoughts?

selbekk pushed a commit to selbekk/redux that referenced this issue Sep 27, 2018
This commit adds a check for whether the user is passing several
enhancers to the `createStore` function.

Fixes reduxjs#3114.
@selbekk
Copy link
Contributor

selbekk commented Sep 27, 2018

I love it enough to create a PR for it :) Perhaps it's a bit too soon - but if nothing else, at least it made me read the source code of Redux for the first time.

Thanks for all your work and efforts on Redux @markerikson!

selbekk pushed a commit to selbekk/redux that referenced this issue Sep 27, 2018
This commit adds a check for whether the user is passing several
enhancers to the `createStore` function.

Fixes reduxjs#3114.
selbekk pushed a commit to selbekk/redux that referenced this issue Sep 27, 2018
This commit adds a check for whether the user is passing several
enhancers to the `createStore` function.

Fixes reduxjs#3114.
timdorr pushed a commit that referenced this issue Sep 27, 2018
This commit adds a check for whether the user is passing several
enhancers to the `createStore` function.

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

No branches or pull requests

2 participants