mojo-mediator

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

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 (messagenext) {
    // do stuff 
    next();
  });
}