Skip to content

Avoid constants usage and autogenerate actions & reducers from single source like Edux does #2199

@dogada

Description

@dogada

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

It's need to add constant for each action name and define separately actions and reducers. In reducers you often need to use switches and each reducer should be able to handle all actions (to return state unchanged for an unknown actions). This leads to unnecessary boilerplate, code duplication and will slowdown reducer stage for complex states.

What is the expected behavior?

It's possible to define state changes once and generate from this single source of truth both actions and reducers fully compatible with current Redux ecosystem. For example of this approach you can see my attempt to improve this situation:

https://github.com/dogada/edux

For every action it has O(1) speed instead of Redux's O(N) where N is number of reducers.

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