node package manager
Easy sharing. Manage teams and permissions with one click. Create a free org »

properjs-controller

Controller

A very useful, arbitrary event and animation frame cycle class.

Installation

npm install properjs-controller --save-dev

Usage

var Controller = require( "properjs-controller" ),
    controller = new Controller();
 
// Bind event 
controller.on( "my-event", function () {
    // Handle event here 
});
 
// Fire event 
controller.fire( "my-event", [...pass arguments here] );
 
// Cycle the animation frame 
controller.go(function () {
    // Handle frames here 
});