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?
I haven't found any obvious way to reset the async state to its initial state (so that
isInitialreturnstrue).I need this manly because of how dialogs work in the material UI library. I currently use a
useEffectto 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 theAbstractStatethat takes care of this. Would this be an acceptable way of accomplishing this and be accepted in the project?