Skip to content

Feature request: reset reducer for simple stores #2

@mturco

Description

@mturco

In namely/frontend, it is somewhat common to reset store properties to their default value in setup operations. For example:

dispatch(setError(null));

For collection stores we can just call the provided clear action but it'd be nice if there was also a reset action for simple stores that just sets the value to the defaultValue. For example:

const {
  set: setError,
  reset: resetError,
  reducer: validationErrors,
} = simpleStore('ui/error', { defaultValue: null });

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions