rxjs-leak-finder vs SubSink
SubSink is a tiny class that collects subscriptions so you can unsubscribe them all in ngOnDestroy. It's a clean way to manage teardown — but only for the subscriptions you remember to add to the sink. rxjs-leak-finder finds the rest.
The short version
SubSink gives you a sink you assign subscriptions to (this.subs.sink = obs$.subscribe(...)), then call this.subs.unsubscribe() in ngOnDestroy. It's an organizational pattern for manual teardown — less error-prone than juggling individual Subscription fields, but still opt-in per subscription.
rxjs-leak-finder doesn't manage subscriptions — it detects the ones that outlived their owner. The subscription you forgot to assign to the sink, the one added after a refactor, the one in a service with no ngOnDestroy: SubSink can't catch those because it never saw them. rxjs-leak-finder sees every subscribe() in the app.
Feature comparison
| Capability | rxjs-leak-finder | SubSink |
|---|---|---|
| Primary job | Detect leaked subscriptions | Organize manual teardown |
| Catches subscriptions you didn't track | ✅ Yes | ❌ No — only what you sink |
| Boilerplate | One line in main.ts | this.subs.sink = … per stream + unsubscribe() in ngOnDestroy |
| Tells you a leak exists | ✅ Dashboard + stack trace | ❌ No detection — assumes you wired it |
| Production footprint | None (dev-only) | Tiny class ships in bundle |
| Maintenance status | Active (2026) | Mature / low activity |
Accurate as of June 2026, per SubSink's README. Spot an error? Open an issue.
They're not rivals
SubSink answers "how do I tear these down cleanly?" rxjs-leak-finder answers "did I miss any?" Keep SubSink (or takeUntilDestroyed) as your teardown mechanism, and run rxjs-leak-finder in dev to prove there are no gaps.
// main.ts (dev only)
import { isDevMode } from '@angular/core';
import { enableRxjsLeakDetector } from 'rxjs-leak-finder';
if (isDevMode()) {
enableRxjsLeakDetector();
}FAQ
Should I replace SubSink with rxjs-leak-finder?
No — they do different jobs. SubSink unsubscribes; rxjs-leak-finder detects leaks. If you want less teardown boilerplate, the modern move is takeUntilDestroyed() (built into Angular 16+), with rxjs-leak-finder verifying it.
Is SubSink still maintained?
It's stable and widely used but sees little new activity — expected for a single-purpose utility. Angular's native takeUntilDestroyed has largely superseded the need for it.
Related: vs until-destroy · vs takeUntil · How to unsubscribe in Angular