Task-based asynchronous callback hook
Task equivalent to useCallback hook allowing to perform asynchronous callbacks
Task execution is automatically interrupted in case of additional calls or unmounting. This way, only one task is running at any given time
callback argument types
task function to be invoked as callback; the task resolves to void
dependency list
callback, current execution status, and cancellation function, as [callback, running, cancel]
Task is not cancelled on hook re-render, but is cancelled on the next call instead
Task-based asynchronous callback hook
Task equivalent to useCallback hook allowing to perform asynchronous callbacks
Task execution is automatically interrupted in case of additional calls or unmounting. This way, only one task is running at any given time