Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset async state to initial #325

Open
MMauro94 opened this issue Oct 18, 2021 · 0 comments
Open

Reset async state to initial #325

MMauro94 opened this issue Oct 18, 2021 · 0 comments

Comments

@MMauro94
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant