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

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

Open
yankeeinlondon opened this issue Mar 15, 2017 · 1 comment
Open

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

yankeeinlondon opened this issue Mar 15, 2017 · 1 comment

Comments

@yankeeinlondon
Copy link

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
Copy link
Contributor

Velenir commented Mar 16, 2017

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.

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

No branches or pull requests

2 participants