Skip to content

Reset async state to initial #325

Description

@MMauro94

I haven't found any obvious way to reset the async state to its initial state (so that isInitial returns true).

I need this manly because of how dialogs work in the material UI library. I currently use a useEffect to clear all other states of the dialog when it is opened, but there is not a way to do this to the async state, so I'm always left with the state of the last operation.

I advocate adding a reset() function to the AbstractState that takes care of this. Would this be an acceptable way of accomplishing this and be accepted in the project?

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions