
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@angular-kit/effects
Advanced tools
Powerful tools to manage observable subscriptions with zero-boilerplate
A modern toolkit using the latest Angular features to effectively manage your effects/subscriptions with zero-boilerplate code needed.
Tooling to handle your effects (subscriptions)!
effectseffectseffects is a convenience function which acts as a container to take care of
multiple subscriptions and execute side effects. It will automatically and safely unsubscribe from
any observable.
Note that you need to use effects within an injection context. If you want to
use it outside an injection context you can pass the Ìnjector as argument.
const eff = effects(({run, runOnCleanUp}) => {
run(interval(1000), v => console.log(v))
// register more effects
runOnCleanUp(() => {
// e.g. save something to local storage
})
})
You also get fine-grained hooks to run code on clean-up of a single effect:
const eff = effects();
const intervalEffect = eff.run(interval(1000), v => console.log(v), {
onCleanUp: () => {
// e.g. save something to local storage
}
});
The onCleanUp-function will be executed either when intervalEffect.cleanUp() is called or when
the effects-instance is destroyed. Note the onCleanUp-function will run only once.
effects pre Angular 16There are several well-established patterns to handle subscriptions in Angular. This example uses plain
subscriptions and unsubscribes in the ngOnDestroy lifecycle hook.
@Component(...)
export class AppComponent implements OnDestroy {
private subscription: Subscription;
constructor() {
this.subscription = interval(1000).subscribe(v => console.log(v));
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
}
effects post Angular 16There are several well-established patterns to handle subscriptions in Angular. This example uses plain
subscriptions and unsubscribes in the ngOnDestroy lifecycle hook.
@Component(...)
export class AppComponent {
private subscription: Subscription;
constructor() {
this.subscription = interval(1000).subscribe(v => console.log(v));
inject(DestroyRef).onDestroy(() => this.subscription.unsubscribe());
}
}
effects@Component(...)
export class AppComponent {
private eff = effects();
constructor() {
this.eff.run(interval(1000).subscribe(v => console.log(v));
}
}
@angular-kit/effects is compatible with Angular versions 16 and above and it requires RxJs >= 7.0.0.
FAQs
Powerful Angular extensions to handle subscriptions and side effects automatically in the background.
The npm package @angular-kit/effects receives a total of 0 weekly downloads. As such, @angular-kit/effects popularity was classified as not popular.
We found that @angular-kit/effects 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.