Skip to content

Forgetting to return shouldn't wipe state #25

@jesseskinner

Description

@jesseskinner

I get tripped up forgetting to add return state to the end of my action handlers, and it's a horrible and hard to figure out issue when suddenly part or all of your state is missing.

I propose simply checking if typeof state === 'undefined' and not changing the state if it is undefined. To wipe the state, one can return null or return {} or something.

Any opinions? Concerns?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions