Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 729 Bytes

no-subscribe-handlers.md

File metadata and controls

39 lines (27 loc) · 729 Bytes

Forbid the passing of handlers to subscribe (no-subscribe-handlers)

This rule effects failures whenever subscribe is called with handlers.

Rule details

Examples of incorrect code for this rule:

import { of } from "rxjs";
import { tap } from "rxjs/operators";

of(42, 54).subscribe((value) => console.log(value));
import { of } from "rxjs";
import { tap } from "rxjs/operators";

of(42, 54).subscribe({
  next: (value) => console.log(value),
});

Examples of correct code for this rule:

import { of } from "rxjs";

of(42, 54)
  .pipe(tap((value) => console.log(value)))
  .subscribe();

Options

This rule has no options.