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

`CONSTRUCT` for creating initial state is not working #11

Closed bitspook closed 8 years ago

bitspook commented 8 years ago

This is my reducer:

// reducers/query.js
let CONSTRUCT;

CONSTRUCT = () => {
    return {
        transportId: 1,
        fromDate: '2015-12-12',
        radius: 100000
    };
};

export default {
    CONSTRUCT
};
// reducers/index.js
export query from './query';

This is how I am creating the store:

initialState = {};
reducer = combineReducers(reducers);
state = reducer(initialState);
store = applyMiddleware(thunk, logger)(createStore)(reducer, state);

I was expecting to get what's returned by CONSTRUCT as state.query, but it fails with the error Uncaught Error: Action parameter value must be an object.

I think this is a bug. Please update me if I am missing something (/ doing something wrong).

gajus commented 8 years ago

Not relevant in redux-immutable@2.0.1.