Wraps a function to make it abortable. The wrapped function will listen to the
provided abort signal and call the onAbort callback if the signal is aborted.
If the signal is already aborted, the onAbort callback will be called
BEFORE calling the original function.
Wraps a function to make it abortable. The wrapped function will listen to the provided abort signal and call the onAbort callback if the signal is aborted.
If the signal is already aborted, the onAbort callback will be called BEFORE calling the original function.