Skip to content

Instantly share code, notes, and snippets.

Avatar

Stas Kohut diamond-darrell

View GitHub Profile
View cancel-on-destroy.ts
import {merge, MonoTypeOperatorFunction, Observable, Operator, Subject, Subscriber, TeardownLogic} from "rxjs";
import {OnDestroy} from "@angular/core";
const __ngOnDestroySource__ = Symbol("__ngOnDestroySource__");
const __ngOnDestroy__ = Symbol("__ngOnDestroy__");
interface EnhancedOnDestroy extends OnDestroy {
[__ngOnDestroySource__]: Subject<string>;
[__ngOnDestroy__]: () => void;
}