index.js
function Animitter( opts ){
    opts = opts || {};

    this.__delay = opts.delay || 0;

    /** @expose */
    this.fixedDelta = !!opts.fixedDelta;

    /** @expose */
    this.frameCount = 0;
    /** @expose */
    this.deltaTime = 0;
    /** @expose */
    this.elapsedTime = 0;

    /** @private */
    this.__running = false;
    /** @private */
    this.__completed = false;

    this.setFPS(opts.fps || Infinity);
    this.setRequestAnimationFrameObject(opts.requestAnimationFrameObject || defaultRAFObject);
}
function Animitter( opts ){
    opts = opts || {};

    this.__delay = opts.delay || 0;

    /** @expose */
    this.fixedDelta = !!opts.fixedDelta;

    /** @expose */
    this.frameCount = 0;
    /** @expose */
    this.deltaTime = 0;
    /** @expose */
    this.elapsedTime = 0;

    /** @private */
    this.__running = false;
    /** @private */
    this.__completed = false;

    this.setFPS(opts.fps || Infinity);
    this.setRequestAnimationFrameObject(opts.requestAnimationFrameObject || defaultRAFObject);
}
function Animitter ( opts ) { opts = opts || { } ; this . __delay = opts . delay || 0 ; /** @expose */ this . fixedDelta = ! ! opts . fixedDelta ; /** @expose */ this . frameCount = 0 ; /** @expose */ this . deltaTime = 0 ; /** @expose */ this . elapsedTime = 0 ; /** @private */ this . __running = false ; /** @private */ this . __completed = false ; this . setFPS ( opts . fps || Infinity ) ; this . setRequestAnimationFrameObject ( opts . requestAnimationFrameObject || defaultRAFObject ) ; }
Animitter provides event-based loops for the browser and node,
using `requestAnimationFrame`
@param {Object} [opts]
@param {Number} [opts.fps=Infinity] the framerate requested, defaults to as fast as it can (60fps on window)
@param {Number} [opts.delay=0] milliseconds delay between invoking `start` and initializing the loop
@param {Object} [opts.requestAnimationFrameObject=global] the object on which to find `requestAnimationFrame` and `cancelAnimationFrame` methods
@param {Boolean} [opts.fixedDelta=false] if true, timestamps will pretend to be executed at fixed intervals always
@constructor
Animitter provides event - based loops for the browser and node using requestAnimationFrame