-
Notifications
You must be signed in to change notification settings - Fork 296
Description
Hi,
When an empty map is passed to handleActions, then Redux is failed because undefined will be returned for undefined state input. This has been already indicated in the discussion of #167 by @geminiyellow. The error message:
Uncaught Error: Reducer "somekeyinsomestateobject" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.
The message comes from Redux, but the problem is caused by implementation of redux-actions' handleActions.
Of course there are not many useful use-cases for an empty map. Reducers of such handleActions basically mean that their associated state elements are unmodifiable, which is not recommended, as far as I know. It can be a "feature", but then the documentation should be updated indicating this mandatory condition.