resulting task resolve type
callback returning the started task, current execution status, and cancellation function, as [callback, running, cancel]
Use useTaskCallbackState when the callback task resolves to void. This hook remains for callbacks whose task resolves to a result.
Task-based asynchronous callback hook that returns the started task
Each call starts a task and returns it. A later call or unmount cancels the previous task asynchronously, from an effect cleanup via setTimeout. cancel() clears the running flag immediately and schedules that same cancellation.
callback argument types