0.0.1 • Published 8 years ago

angular-microbus v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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