withLoadingState<A, R>(callback: ((...args: A) => Promise<R>)): CallbackWithState<((...args: A) => Promise<R>), { loading: boolean; }>
Adds a loading state which is initially false.
Once the callback is invoked, it is set to true.
After the callback resolves or rejects, it is set to false again.
Adds a
loading
state which is initially false. Once the callback is invoked, it is set to true. After the callback resolves or rejects, it is set to false again.Returns
callback with a
loading
stateSee
CallbackWithState