Function
Static Public Summary | ||
public |
delays the call to nextFrame with setTimeout |
|
public |
create a Promise that resolves in the next Animationframe |
|
public |
create an animationframe loop that calls a function (callback) in every frame |
|
public |
create a Promise that resolves in the next Animationframe |
|
public |
call a function sequencely every next frame on every iterating position of an array |
|
public |
create a throttled animationframe loop that calls a function (callback) in every specified |
|
public |
until fn returns a truthy value do not resolve. |
|
public |
waiting x frames before the Promise will resolve |
|
public |
resolve when fn returns a truthy value. |
Static Public
public delay(ms: Number, args: ...): Promise source
import delay from 'nextframe/src/delay.js'
delays the call to nextFrame with setTimeout
Params:
Name | Type | Attribute | Description |
ms | Number | delay in ms |
|
args | ... | optional values that would be the params of the Promises resolve |
public frame(args: ...): Promise source
import frame from 'nextframe/src/frame.js'
create a Promise that resolves in the next Animationframe
Params:
Name | Type | Attribute | Description |
args | ... | optional values that would be the params of the Promises resolve |
public loop(cb: Function): Function source
import loop from 'nextframe/src/loop.js'
create an animationframe loop that calls a function (callback) in every frame
Params:
Name | Type | Attribute | Description |
cb | Function | gets called in every frame - for rendering mostly |
public nextFrame(args: ...): Promise source
import nextFrame from 'nextframe/src/nextframe.js'
create a Promise that resolves in the next Animationframe
Params:
Name | Type | Attribute | Description |
args | ... | optional values that would be the params of the Promises resolve |
public sequence(collection: Array, fn: Function): Promise source
import sequence from 'nextframe/src/sequence.js'
call a function sequencely every next frame on every iterating position of an array
public throttle(cb: Function, frames: Number): Function source
import throttle from 'nextframe/src/throttle.js'
create a throttled animationframe loop that calls a function (callback) in every specified
public until(fn: Function, args: ...): Promise source
import until from 'nextframe/src/until.js'
until fn returns a truthy value do not resolve.
Params:
Name | Type | Attribute | Description |
fn | Function | a function that will be called every frame to check for changes |
|
args | ... | optional values that would be the params of the Promises resolve |
public wait(frame: Number, args: ...): Promise source
import wait from 'nextframe/src/wait.js'
waiting x frames before the Promise will resolve
Params:
Name | Type | Attribute | Description |
frame | Number | the number of frames the Promise waits before resolving |
|
args | ... | optional values that would be the params of the Promises resolve |
public when(fn: Function, args: ...): Promise source
import when from 'nextframe/src/when.js'
resolve when fn returns a truthy value.
Params:
Name | Type | Attribute | Description |
fn | Function | a function that will be called every frame to check for changes |
|
args | ... | optional values that would be the params of the Promises resolve |