Skip to main content

scheduleAndCancelPromise

Calls the supplied function using a Promise and cancels a pending call with the specified handle.

Signature

scheduleAndCancelPromise(
fn: ((...arguments: any[]) => void) | undefined,
handle: number,
...arguments: any[]
): number

Parameters

NameTypeOptionalDescription
fn((...arguments: any[]) => void) | undefinedNoSpecifies the function to execute.
handlenumberNoSpecifies the handle of the call to cancel.
argumentsany[]YesOptional arguments which should be passed to the callee.

Return value

Returns the call handle. Can be used to cancel the call using cancelPromise or another scheduleAndCancelPromise call.