2.0.1 • Published 6 years ago

@bakesaled/mesh-jack v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

mesh-jack

Build Status Coverage Status

A decoupled message bus for Angular.

mesh-jack provides a way to communicate between components without having to inject lots of services.

Install

To use mesh-jack in your project, install it via yarn:

yarn add @bakesaled/mesh-jack

or via npm:

npm i @bakesaled/mesh-jack

Usage

Subscribe

constructor(private bus: BusService) {}

ngOnInit() {
    this.bus.channel('channel A').subscribe(message => {
      console.log('message received', message.data);
    });
}

Publish

constructor(private busService: BusService) {}

doPublish() {
    this.busService.publish('channel A', { source: this, data: 'my message' });
}

Examples

Demo page

2.0.1

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago