Pub/Sub Service for Angular
A simple publisher/subscriber service. This repository is forked from angular-pubsub, changed RXJs version to 6 and above; and added angular 9 support.
- 2.3.1 fixed fixed minor issue on
i0.ɵɵFactoryDef<PubSubService>;(changed angular compatibility to 9.1)
- 2.3.0 release is compatible with angular 9.0.7
- Import service in your codes or download via npm or bower.
npm i --save @shaaakh/ngx-pubsub
- Add module bundle to imports in your application.
...; // <= HERE...
- And import service wherever you want
PubSubService.$pub(event: string, eventObject?: any): void
Publish event to all subscriber.
PubSubService.$sub(event: string): Observable
Subscribe to channel.
Build the source
Follow the steps to run the tests and build the source code.
npm installnpm testnpm run build
Commands above will generate the ready to use bundles under the