Register a callback that will be called when the signal is cancelled.
The callback to register.
Clear a callback that was registered with onCancelled
.
The callback to clear. Should be the same function that was registered with
onCancelled
.
Check if the signal is cancelled.
true
if the signal is cancelled, false
otherwise.
A cancel signal is similar to an AbortSignal. It allows you to check for cancellation and register a callback that will be called when the signal is cancelled.
Example