delayCall

Util.delayCall()
delayCall(cb: (cbArgs: unknown[]) => unknown, args: unknown[]): Timeout

This function is an helper function that delay the call to a callback to the computation of the next ‘frame’ of the browser’s js engine. The point is to let the js engine deal with pending promises before running the given code.

Parameters

cb: (cbArgs: unknown[]) => unknown

the callback to call the promise to call on the next frame.

args: unknown[]

the arguments of the callback.

Returns: Timeout

a timeout id in order to cancel it if necessary.