@bakesaled/mesh-jack
v2.0.1
Published
Decoupled Angular message bus.
Downloads
2
Maintainers
Readme
mesh-jack
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' });
}