Mediocre.js
Mediocre is a lightweight JavaScript mediator.
Features
- ability to add pre / post hooks
- ability to call commands with options (see below)
var mediator = ; mediator; //login helpermediator; //add pre-hook into login to validate fieldsmediator; // spy on a message being executedmediator;
API
mediator.on(event, listeners...)
adds a listener
mediator.execute(listener[, data][, callback])
executes a command
message mediator.message(name[, data][, options])
creates a new message option to dispatch
mediator; mediator; //executes hello with options worldmediator; //same as above commandmediator;