fn.withCancel
Execute a function with automatic cancellation propagation.
Creates a CancelGuard, passes its token to the provided function, and cancels the guard when the function returns. The cancellation happens regardless of how the function exits (normal return, exception, or early return).
Parameters
fn | Function to execute. Receives a CancelToken as the first argument. |
args | Additional arguments forwarded to fn. |
Returns
The value returned by