
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Ng-Sub is a lightweight tool used to manage rxjs subscriptions and prevent memory leakage.
NgSub is a lightweight tool provided by Anchor Solutions that can be used to manage RxJs subscriptions and prevent memory leakages when working, subscribe to data streams in JavaScript or any of its framework. Usable both in browser and Node.js environments.
Install ng-sub via npm by running the following command:
npm install ng-sub --save
Register the NgSubModule
in your app module (or any other module you want to use it).
import { NgSub } from 'ng-sub';
const sub = new NgSub();
const observable: Observable = of(null);
// use the service with takeUntil when subscribing to any observable
observable.pipe(takeUntil(sub)).subscribe();
// Or use it to manage multiple subscriptions
sub.add(sub1, sub2, sub3);
// when done, remember to unsubscribe all subscriptions in one place
sub.unsubscribe();
import { NgSub } from 'ng-sub';
import { Observable, of } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@Component({
selector: 'app-selector',
templateUrl: '<h1>Template html</h1>',
styleUrls: ['css path here...']
})
export class ComponentA implements OnInit, OnDestroy {
private sub = new NgSub();
constructor() {}
ngOnInit(): void {
const observable: Observable = of(null);
// use the service with takeUntil when subscribing to any observable
observable.pipe(takeUntil(this.sub)).subscribe();
// Or use it to manage multiple subscriptions
this.sub.add(sub1, sub2, sub3);
}
ngOnDestroy(): void {
this.sub.unsubscribe();
}
}
FAQs
Ng-Sub is a lightweight tool used to manage rxjs subscriptions and prevent memory leakage.
The npm package ng-sub receives a total of 8 weekly downloads. As such, ng-sub popularity was classified as not popular.
We found that ng-sub demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.