0.2.0 • Published 9 years ago

mojo-mediator v0.2.0

Weekly downloads
3
License
BSD-2-Clause
Repository
github
Last release
9 years ago

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();
  });
}