Class: Ticker

Bling.ticker. Ticker

new Bling.ticker.Ticker()

bling/ticker/Ticker.js, line 9

Ticker 类,用于循环调度,这里通过 setTimeout 模拟

Methods

add(fn, context){Bling.ticker.Ticker}

bling/ticker/Ticker.js, line 50

Register a handler for tick events. Calls continuously unless it is removed or the ticker is stopped.

Name Type Description
fn function

The listener function to be added for updates

context function optional

The listener context

Returns:
Type Description
Bling.ticker.Ticker This instance of a ticker

addOnce(fn, context){Bling.ticker.Ticker}

bling/ticker/Ticker.js, line 60

Add a handler for the tick event which is only execute once.

Name Type Description
fn function

The listener function to be added for one update

context function optional

The listener context

Returns:
Type Description
Bling.ticker.Ticker This instance of a ticker

destroy()

bling/ticker/Ticker.js, line 110

Destroy the ticker and don't use after this. Calling this method removes all references to internal events.

remove(fn, context){Bling.ticker.Ticker}

bling/ticker/Ticker.js, line 71

Removes any handlers matching the function and context parameters.
If no handlers are left after removing, then it cancels the animation frame.

Name Type Description
fn function

The listener function to be removed

context function optional

The listener context to be removed

Returns:
Type Description
Bling.ticker.Ticker This instance of a ticker

start()

bling/ticker/Ticker.js, line 92

Starts the ticker. If the ticker has listeners a new animation frame is requested at this point.

stop()

bling/ticker/Ticker.js, line 101

Stops the ticker. If the ticker has requested an animation frame it is canceled at this point.

Documentation generated by JSDoc 3.4.3 on Thu Jul 09 2020 18:39:28 GMT+0800 (CST)