Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 430 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 430 Bytes

Add event capabilities

  • Add event capabilities to a Javascript Object

  • AMD Support (RequireJS / NodeJS)

Usage

    // Initialize
    var myObject = {};
    addEventCapabilities(myObject);
    
    
    // Register event
    myObject.on('my custom event', function(value1, value2 /*, .... */) {
        // ...
    });
    
    // Fire event
    myObject.emit('my custom event', 15, { hello: "world" });