Delayable

Properties

2
isDelayable: Boolean= truereadonly
Identifies an object as an instance of Delayable class, or subclass thereof.
isDelayable: Boolean= truereadonlystatic
Identifies an object as an instance of Delayable class, or subclass thereof.

Functions

1

Creates a function which will execute once, on the next animation frame. However many time it is called in one event run, it will only be scheduled to run once.

ParameterTypeDescription
fnfunction | String

The function to call, or name of function in this object to call.

argsObject[]

The argument list to append to those passed to the function.

thisObjObject

this reference for the function.

cancelOutstandingBoolean

Cancel any outstanding queued invocation upon call.

Returns: function -

A function which can be called multiple times, and will only execute once on the next animation frame

Typedefs

1

Configuration options available when defining a delayable function.

ParameterTypeDescription
typebuffer | raf | idle | throttle

Type of delay to use. raf is short for requestAnimationFrame, 'idle' for requestIdleCallback (not supported in Safari)

delayNumber

Number of milliseconds to wait before (buffer) or after (throttle) calling the underlying method. A value of 0 is equivalent to setting immediate: true.

immediateBoolean

Set to true to call immediately (effectively disabling the buffer/throttle)

cancelOutstandingBoolean

Set to true to cancel any pending animation frame requests and schedule a new one on each call.