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

Core enhancer #1705

Closed
wants to merge 2 commits into from
Closed

Core enhancer #1705

wants to merge 2 commits into from

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented May 9, 2016

Following up on my comment from #1702, this PR makes createStoreBase less opinionated by moving certain invariants (actions must be plain objects; actions must have type field) into a coreEnhancer that is applied automatically by createStore. This allows for a future in which createStoreBase (or whatever we end up naming it) can be exported separately, providing a cleaner integration point for userland experiments and alternative createStore APIs that may want to opt-out of those assumptions that, while they may make sense for the majority of Redux consumers, aren't essential to the nature of Redux.

With this separation, createStore is now almost exclusively concerned with subscriptions. I like this because it should make all parties happier: tinkerers can opt-out of "conveniences" that they don't like (such as the INIT action) without having to rewrite any subscription logic, which in turn makes the barrier to adding more conveniences to createStore lower. This is similar in spirit to how we currently treat combineReducers: if you don't like how it works, you don't have to use it.

@acdlite
Copy link
Collaborator Author

acdlite commented May 9, 2016

Oops submitted to the wrong branch. Closing and retrying.

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

Successfully merging this pull request may close these issues.

2 participants