Skip to content

Possible error in applyMiddlewares/createStore #2200

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

Closed
fourlastor opened this issue Jan 12, 2017 · 1 comment
Closed

Possible error in applyMiddlewares/createStore #2200

fourlastor opened this issue Jan 12, 2017 · 1 comment

Comments

@fourlastor
Copy link

fourlastor commented Jan 12, 2017

I was checking out the source code for https://github.com/reactjs/redux/blob/master/src/applyMiddleware.js#L20 and https://github.com/reactjs/redux/blob/master/src/createStore.js#L50 and noticed one thing:

// createStore.js
return enhancer(createStore)(reducer, preloadedState);
// applyMiddleware.js
return (createStore) => (reducer, preloadedState, enhancer) => {

So as far as I understood, applyMiddleware's (and any store enhancer's) signature is (createStore) => createStore, while createStore is assuming (createStore) => (reducer, preloadedState).

Which one should be the correct one? I would assume (createStore) => createStore.

@fourlastor fourlastor changed the title Possible error in applyMiddlewares Possible error in applyMiddlewares/createStore Jan 12, 2017
@jimbolla
Copy link
Contributor

See #2128 (comment)

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