Skip to content

Latest commit

 

History

History
58 lines (31 loc) · 1.79 KB

interval.md

File metadata and controls

58 lines (31 loc) · 1.79 KB

futuriseDocs


futurise / interval

Function: interval()

interval(duration, callback)

interval(duration, callback): Unregister

Calls callback at least every duration milliseconds. Returns a function that stops future calls of callback. If the duration is 0, it uses requestAnimationFrame if available.

Parameters

duration: number

Minimum duration of each interval in milliseconds.

callback

Called at the end of each interval.

Returns

Unregister

Function that cancels the interval.

Defined in

tools/interval.ts:20

interval(duration)

interval(duration): Register<ListenerTimer, undefined>

Returns a function that registers a callback to be called at least every duration milliseconds. If the duration is 0, if uses requestAnimationFrame if available. The interval is set during this call.

Parameters

duration: number

Minimum duration of each interval in milliseconds.

Returns

Register<ListenerTimer, undefined>

Function that registers a callback to call at each elapsed interval, and returns a function that unregisters it. If the latter function unregisters the last callback, it clears the interval. When registering a callback on a cleared interval, throws an Error exception.

Defined in

tools/interval.ts:29