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

Reducer is not a function (within state tree) #62

Open yankeeinlondon opened 7 years ago

yankeeinlondon commented 7 years ago

Loving the ReduxImmutable library and using it's implementation of combineReducers for my root state without problem. However, I have a node off the state tree called forecast which I'd like to further separate into a set of reducers with the following:

import ReduxImmutable from 'npm:redux-immutable';
const { combineReducers } = ReduxImmutable;

import meta from './forecast/meta';
import history from './forecast/history';
import versions from './forecast/versions';

export default combineReducers({
  meta,
  history,
  versions
});

When I do this however, I get the message:

reducer is not a function

From the following code block:

2017-03-15_12-27-02

Any idea why this would be? For reference sake, here is the root reducer (which works so long as "forecast" is a regular reducer and not a combineReducer mutex):

import ReduxImmutable from 'npm:redux-immutable';
const { combineReducers } = ReduxImmutable;

import accounts from './accounts';
import counterparties from './counterparties';
import firebase from './firebase';
import forecast from './forecast';
import org from './org';
import registration from './registration';
import users from './users';
import userProfile from './userProfile';

export default combineReducers({
  accounts,
  counterparties,
  firebase,
  forecast,
  org,
  registration,
  users,
  userProfile
});
Velenir commented 7 years ago

Can one of the reducers you are combining (meta, history, versions) be not a function? They must be proper reducers of function(state, action) kind.