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

Support nested reducers #24

Merged
merged 2 commits into from
Mar 2, 2016
Merged

Support nested reducers #24

merged 2 commits into from
Mar 2, 2016

Conversation

mathisonian
Copy link
Contributor

As discussed in #22, this PR adds support for nested combineReducers calls by defaulting to an empty immutable map if the inputState is undefined.

This adds a test for this behavior as well.

@gajus
Copy link
Owner

gajus commented Mar 1, 2016

This makes immutable a direct dependency, i.e. requires removing immutable from peerDependencies and devDependencies and adding to dependencies.

@mathisonian
Copy link
Contributor Author

updated.

@holymonson
Copy link

This mgiht be simpler:

@@ -10,7 +11,7 @@ export default (reducers: Object) => {

     reducerKeys = Object.keys(reducers);

-    return (inputState, action) => {
+    return (inputState = Immutable.Map(), action) => {
         /* eslint-disable no-process-env */
         if (process.env.NODE_ENV !== 'production') {
         /* eslint-enable no-process-env */

@mathisonian
Copy link
Contributor Author

I'll defer to @gajus on the style. happy to update the PR

gajus added a commit that referenced this pull request Mar 2, 2016
@gajus gajus merged commit 84a5218 into gajus:master Mar 2, 2016
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.

None yet

3 participants