futurise • Docs
futurise / interval
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.
• duration: number
Minimum duration of each interval in milliseconds.
• callback
Called at the end of each interval.
Function that cancels the interval.
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.
• duration: number
Minimum duration of each interval in milliseconds.
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.