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 wrapped function will throw an AbortError
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 wrapped function will throw an AbortError before calling the original function.