Skip to content

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.

3 participants