Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

Packages

Used by

Contributors

Languages