Milo Mordaunt
1 min readMar 22, 2016

--

All looks fine to me :)

As long as the reducer is simple there’s no need to break it out into multiple files.

I would clarify that the reducer itself is the switch block/function(s) that describe the transformation of state. What you’ve posted is the default state of the reducer, so in this article’s example the whole app state is just:

const defaultState = new Immutable.List();

Then every time an action is fired the switch block below runs and a new state is returned.

Because every time you want to return a new state object, it might be more natural to use Immutable.js or a similar library to make the actual reducer code simpler. I can’t see what your doing, but the section here on avoiding state mutation might help.

--

--