gajus / redux-immutable

redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
Other
1.88k stars 82 forks source link

combineReducers in child reducers #36

Closed AnnatarHe closed 8 years ago

AnnatarHe commented 8 years ago

Hello, I am a beginner in redux and immutable.js

I found something weird with combineReducers.

When I use redux-immutable in child reducers. The error always there.

My Code is like this:

import { combineReducers } from 'redux-immutable'
import foo from './fooReducers'
import bar from './barReducers'
import { getReducersFromOthers } from './bazReducers' // It return an Object. and it works without combine child reducers

let rootReducers = {
    foo,
    bar
}

rootReducers['others'] = combineReducers(getReducersFromOthers())

export default rootReducers
// warning.js:14 Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.

I notice that redux.combineReducers and redux-immutable.combineReducers are returned different things.

I want to know is how can I use combineReducers with child reducers.

Sorry for my English. I hope you could understand what I said. Thanks

gajus commented 8 years ago

Please provide a dump of getReducersFromOthers().

AnnatarHe commented 8 years ago

Oh, I know what I missed.

I forgot to rest the result from getReducersFromOthers() last day.

I do this, and merge result to An Object. It works. All my fault T_T Thanks.