We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Note: using immutable ^3.8.1
^3.8.1
Creating store works fine in browser.
But in node v9.2.0 test environment, combineReducers was complaining that finalReducers.filter is not a function.
combineReducers
finalReducers.filter
TypeError: finalReducers.filter is not a function at combineReducers (node_modules/redux-immutablejs/lib/utils/combineReducers.js:83:33)
I instrumented combineReducers thus:
// redux-immutablejs/lib/utils/combineReducers.js function combineReducers(reducers) { var finalReducers = isImmutable(reducers) ? reducers : _immutable2['default'].fromJS(reducers); console.log(` reducers was a ${typeof reducers} reducers ${isImmutable(reducers) ? 'is' : 'is not' } immutable reducers keys: ${Object.keys(reducers).length} finalReducers is a ${typeof finalReducers} finalReducers ${_immutable2['default'].Map.isMap(finalReducers) ? 'is' : 'is not'} a Map fromJS(finalReducers) is a ${ _immutable2['default'].Map.isMap( _immutable2['default'].fromJS(reducers) ) ? 'Map' : _immutable2['default'].List.isList( _immutable2['default'].fromJS(reducers) ) ? 'List' : 'not list or map?' } ` ) finalReducers = finalReducers.filter(function (v) { return typeof v === 'function'; }); // ...
Browser (Chrome) output:
reducers was a object reducers is not immutable reducers keys: 29 finalReducers is a object finalReducers is a Map
On node v9.2.0 Error
reducers was a object reducers is not immutable reducers keys: 29 finalReducers is a object finalReducers is not a Map
I just convert to map before I pass into combineReducers
It must be something to do with the node environment (babel?). But perhaps for safety's sake:
var finalReducers = isImmutable(reducers) ? reducers : _immutable2['default'].fromJS(reducers);
could be changed to:
var finalReducers = isImmutable(reducers) ? reducers : _immutable2['default'].Map(reducers);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Observation
Problem
Note: using immutable
^3.8.1
Creating store works fine in browser.
But in node v9.2.0 test environment,
combineReducers
was complaining thatfinalReducers.filter
is not a function.Research
I instrumented
combineReducers
thus:Browser (Chrome) output:
On node v9.2.0 Error
Work-around
I just convert to map before I pass into combineReducers
Naive suggestion
It must be something to do with the node environment (babel?). But perhaps for safety's sake:
could be changed to:
The text was updated successfully, but these errors were encountered: