Skip to content

Commit c5093a1

Browse files
docs(no-ignored-subscription): when not to use it
1 parent 8f0c7e8 commit c5093a1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/rules/no-ignored-subscription.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ const numbers = new Observable<number>(subscriber => {
3131
interval(1e3).subscribe(subscriber);
3232
});
3333
```
34+
35+
## When Not To Use It
36+
37+
If you don't care about unsubscribing from all observables in your project, then you may not need this rule.
38+
Alternatively, your project might use operators like `take`, `takeUntil`, `takeWhile`, etc.
39+
or Angular's `takeUntilDestroyed` to automatically handle subscriptions.
40+
41+
Type checked lint rules are more powerful than traditional lint rules, but also require configuring type checked linting.
42+
43+
## Resources
44+
45+
- [Rule source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/src/rules/no-ignored-subscription.ts)
46+
- [Test source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/tests/rules/no-ignored-subscription.test.ts)

0 commit comments

Comments
 (0)