mediator module
$ npm install --save mediator-module
var MediatorModule = require('mediator-module');
class FirstMediatorModule extends MediatorModule {
constructor () {
super();
this.mediator.subscribe('test', this.aTestFunction);
}
*aTestFunction () {
console.log('a func called');
}
}
class SecondMediatorModule extends MediatorModule {
constructor () {
super();
}
testPublish () {
this.mediator.publish('test');
}
}
MIT © PAIO co.,ltd.