mojo-mediator

0.2.0 • Public • Published

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

/mojo-mediator/

    Package Sidebar

    Install

    npm i mojo-mediator

    Weekly Downloads

    2

    Version

    0.2.0

    License

    BSD-2-Clause

    Last publish

    Collaborators

    • architectd
    • crcn