Skip to content

handleAction always triggers if not FSA #185

@inxilpro

Description

@inxilpro

The code revert referenced in #177 results in handleAction always running the reducer if an action with no type is dispatched:

if (type && !includes(actionTypes, type.toString())) {
  return state;
}

return (action.error === true ? throwReducer : nextReducer)(state, action);

It seems to me that it should be:

if (!type || !includes(actionTypes, type.toString())) {
  return state;
}

return (action.error === true ? throwReducer : nextReducer)(state, action);

…so that the reducer simply returns the existing state if no type is provided in an action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions