angular-microbus

0.0.1 • Public • Published

angular-microbus

Circle CI

Join the chat at https://gitter.im/asilluron/angular-microbus

Microbus service for angular. 100% ES6 and 100% Tested

Install

npm install angular-microbus ---save

Usage

Import the 'microbus' module and begin using the message bus

let myApp = angular.module('myApp', ['microbus']);

After importing the microbus module, you can use the microbus service anywhere in your app

Push to the bus

function(scope, microbus) {
  microbus.push({some: 'data'}, {key: 'org.namespace'});
}

Consume from the bus

function(scope, microbus) {
  var cb = data => { console.log(`new color added: ${data}!`) };
  microbus.consume(cb, {key: colors});

  // microbus.push('blue', {key: 'org.namespace'}); --> 'new color added: blue!'
}

Development

npm install
npm run tdd

Package Sidebar

Install

npm i angular-microbus

Weekly Downloads

3

Version

0.0.1

License

MIT

Last publish

Collaborators

  • asilluron