Informer.prototype.on >= 0.1.3

Purpose

Add an event listener

Syntax

Informer#on ( StringtypeFunctionlistenerObjectcontext );

Parameters

type

listener

context

Return values

Examples

Add a simple event listener

var instance = new Informer();

instance.on('test', function onTest(data) {
    console.log(data);
    >>> "my-message"
});

instance.emit('test', 'my-message');

Comments