Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 811 Bytes

no-redundant-notify.md

File metadata and controls

32 lines (21 loc) · 811 Bytes

Avoid sending redundant notifications (no-redundant-notify)

This rule effects failures if an attempt is made to send a notification to an observer after a complete or error notification has already been sent.

Note that the rule does not perform extensive analysis. It uses a straightforward and limited approach to catch obviously redundant notifications.

Rule details

Examples of incorrect code for this rule:

import { Subject } from "rxjs";

const subject = new Subject<number>();
subject.next(42);
subject.error(new Error("Kaboom!"));
subject.complete();

Examples of correct code for this rule:

import { Subject } from "rxjs";

const subject = new Subject<number>();
subject.next(42);
subject.error(new Error("Kaboom!"));

Options

This rule has no options.