gajus / gajus/redux-immutable

Reducer is not a function (within state tree)

Open
#62 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.9k
Forks
84
PR merge metrics
No merged PRs in 30d

Description

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](https://cloud.githubusercontent.com/assets/980757/23967103/e5f254de-097a-11e7-9da6-4d7fedaccb57.png)

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
});

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the nested forecast reducer entry point and the modules ./forecast/meta, ./forecast/history, and ./forecast/versions; compare their exports with the combineReducers call. Then inspect the root reducer's forecast wiring and reproduce the error, confirming done when the nested reducer accepts the expected reducer shape without the runtime message.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.