nk-mediator

1.1.1 • Public • Published

mediator

Mediator module (based on component/emitter)

Installation

Install with component(1):

$ component install nk-components/mediator

With npm:

$ npm i -S nk-mediator

Usage

var mediator = require('nk-mediator');
 
function handler(param) {}
 
mediator.sub('channel', handler);
mediator.subOnce('channel', function(param) {});
 
mediator.unsub('channel', handler);
 
mediator.pub('channel', 'param1', 'param2');

License

MIT

/nk-mediator/

    Package Sidebar

    Install

    npm i nk-mediator

    Weekly Downloads

    1

    Version

    1.1.1

    License

    MIT

    Last publish

    Collaborators

    • kewah