
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@cmss/angular-pubsub
Advanced tools
A simple publisher/subscriber service. This repository is forked from angular-pubsub and the only reason I changed it was to use RXJs version 6 and above. and updated the angular packages.
All credit goes to the owner and contributers of angular-pubsub repo.
npm i --save angular7-pubsub
...
import { PubSubModule } from 'angular7-pubsub'; // <= HERE
@NgModule({
declarations: [
RootComponent,
NavigationComponent,
OverlayComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
PubSubModule.forRoot() // <= AND HERE
],
providers: [],
bootstrap: [RootComponent]
})
...
declare class PubSubService {
private events: Object;
$pub(event: string, eventObject?: any): void;
$sub(): undefined;
$sub(event: string): Observable<any>;
$sub(event: string, callback: (value: any) => void): Subscription;
$sub(event: string, callback: (value: any) => void, error: (error: any) => void): Subscription;
$sub(event: string, callback: (value: any) => void, error: (error: any) => void, complete: () => void): Subscription;
}
Publish event to all subscriber.
etc.
export class OverlayComponent implements OnInit, OnDestroy {
constructor(private pubsub: PubSubService) { }
anyFunc(){
this.pubsub.$pub('pleaseCloseSidenav', 'helloIAmOverlay');
}
}
Subscribe to channel.
etc.
export class NavigationComponent implements OnInit, OnDestroy {
closeSidenavSub: Subscription;
openSidenavSub: Subscription;
constructor(private pubsub: EventDispatcherService) { }
ngOnInit() {
// usage of $sub(event: string): <Observable<any>>;
this.closeSidenavSub = this.pubsub.$sub('pleaseCloseSidenav').subscribe((from) => {
this.sidenavOpened = false;
});
// usage of $sub(event: string, callback: (value: any) => void, error?: (error: any) => void, complete?: () => void): Subscription;
this.openSidenavSub = this.pubsub.$sub('pleaseOpenSidenav', (from) => {
this.sidenavOpened = true;
});
}
ngOnDestroy() {
this.closeSidenavSub.unsubscribe();
this.openSidenavSub.unsubscribe();
}
See Changelog $sub method have one bug. RxJS Subscriber call subscribe method on start like Angular 1.x $scope.$watch.
Follow the steps to run the tests and build the source code.
npm install
npm test
npm run build
Commands above will generate the ready to use bundles under the ./dist folder.
FAQs
Pub/Sub service for Angular 7 and above
We found that @cmss/angular-pubsub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.