
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
ng2-destroy-subscribers
Advanced tools
Install it from npm:
npm install ng2-destroy-subscribers
Подключение декоратора
import {DestroySubscribers} from "ng2-destroy-subscribers";
@Component({
...
})
@DestroySubscribers({
addSubscribersFunc: 'addSubscribers',
removeSubscribersFunc: 'removeSubscribers',
initFunc: 'ngOnInit',
destroyFunc: 'ngOnDestroy',
})
export class TestComponent {
public subscribers: any = {};
addSubscribers() {
this.subscribers.testSubscriber = Observable.of('true')
.subscribe(response => {
console.log(response);
})
}
}
subscribers - Обьект в котором хранятся все подписчикиaddSubscribersFunc - Функция в которой мы подписываемся на стримы (по умолчанию - addSubscribers)removeSubscribersFunc - Функция в которой автоматически удаляются подписчики (по умолчанию - removeSubscribers)initFunc - Функция которая вызывается при срабатывании конструктора (по умолчанию - ngOnInit)destroyFunc - Функция которая вызывается при срабатывании деструктора (по умолчанию - ngOnDestroy)FAQs
Typescript component aut destroy subscribers
We found that ng2-destroy-subscribers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.