JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 320
  • Score
    100M100P100Q89556F
  • License Apache2

Mediator pattern for the web and node

Package Exports

  • mediatorjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mediatorjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mediatorjs

Simple mediator pattern written in JS

mediator is a singleton. It is instantiated as soon as you require it and should remain alive as long as your app does. It is derived from marionette's wreqr, but we found a lot of trouble with circular dependencies while it was pre-packaged.

API

var mediator = require('mediatorjs');

// get and set for pseudo dependency injection
mediator.set('hello', 1);
mediator.get('hello'); // results in 1

// trigger
mediator.on('blah', function(data) {});
mediator.trigger('blah', {});