lib/animation-frame.js
function AnimationFrame(options) {
    if (!(this instanceof AnimationFrame)) return new AnimationFrame(options)
    options || (options = {})

    // Its a frame rate.
    if (typeof options == 'number') options = {frameRate: options}
    options.useNative != null || (options.useNative = true)
    this.options = options
    this.frameRate = options.frameRate || AnimationFrame.FRAME_RATE
    this._frameLength = 1000 / this.frameRate
    this._isCustomFrameRate = this.frameRate !== AnimationFrame.FRAME_RATE
    this._timeoutId = null
    this._callbacks = {}
    this._lastTickTime = 0
    this._tickCounter = 0
}
function AnimationFrame(options) {
    if (!(this instanceof AnimationFrame)) return new AnimationFrame(options)
    options || (options = {})

    // Its a frame rate.
    if (typeof options == 'number') options = {frameRate: options}
    options.useNative != null || (options.useNative = true)
    this.options = options
    this.frameRate = options.frameRate || AnimationFrame.FRAME_RATE
    this._frameLength = 1000 / this.frameRate
    this._isCustomFrameRate = this.frameRate !== AnimationFrame.FRAME_RATE
    this._timeoutId = null
    this._callbacks = {}
    this._lastTickTime = 0
    this._tickCounter = 0
}
function AnimationFrame ( options ) { if ( ! ( this instanceof AnimationFrame ) ) return new AnimationFrame ( options ) options || ( options = { } ) // Its a frame rate. if ( typeof options == 'number' ) options = { frameRate : options } options . useNative != null || ( options . useNative = true ) this . options = options this . frameRate = options . frameRate || AnimationFrame . FRAME_RATE this . _frameLength = 1000 / this . frameRate this . _isCustomFrameRate = this . frameRate !== AnimationFrame . FRAME_RATE this . _timeoutId = null this . _callbacks = { } this . _lastTickTime = 0 this . _tickCounter = 0 }
Animation frame constructor.

Options:
- `useNative` use the native animation frame if possible, defaults to true
- `frameRate` pass a custom frame rate

@param {Object|Number} options
Animation frame constructor .