node package manager

mojo-mediator

Mojo-mediator is a plugin that provides a communication layer for different parts of your application. It uses <a href="https://github.com/classdojo/mediocre.js">mediocre.js</a>.

Mojo-mediator is a plugin that provides a communication layer for different parts of your application. It uses mediocre.js.

entry.js:

var mojo = require("mojojs"),
app      = new mojo.Application();
 
app.
  use(require("mojo-mediator")).
  use(require("./commands"));
 
app.mediator.execute("initialize", function () {
});

commands/index.js

module.exports = function (app) {
  app.mediator.on("initialize", function (message, next) {
    // do stuff 
    next();
  });
}