Skip to content

Feature request: reset reducer for simple stores #2

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 });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions