1.1.1 • Published 9 years ago

nk-mediator v1.1.1

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

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