You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the useAsyncState function, which provides a useful onError option to do something on failure. Also, I often do something else after a successful execution, but I don't seem to see an option like onSuccess in the type definition of the UseAsyncStateOptions interface. I wonder if it would be useful to add a similar onSuccess option.
Suggested solution
Add an onSuccess option to the UseAsyncStateOptions interface.
Alternative
I achieved my purpose by using the following code, but I think providing onSuccess option can save writing these boilerplate codes.
Clear and concise description of the problem
I'm using the
useAsyncState
function, which provides a usefulonError
option to do something on failure. Also, I often do something else after a successful execution, but I don't seem to see an option likeonSuccess
in the type definition of the UseAsyncStateOptions interface. I wonder if it would be useful to add a similaronSuccess
option.Suggested solution
Add an
onSuccess
option to theUseAsyncStateOptions
interface.Alternative
I achieved my purpose by using the following code, but I think providing onSuccess option can save writing these boilerplate codes.
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: