UNPKG

@ngx-cocktail/destroyable

Version:

[![npm version](https://img.shields.io/npm/v/@ngx-cocktail/destroyable.svg)](https://www.npmjs.com/package/@ngx-cocktail/destroyable) [![npm downloads](https://img.shields.io/npm/dm/@ngx-cocktail/destroyable.svg)](https://www.npmjs.com/package/@ngx-cockta

26 lines (21 loc) 988 B
import * as i0 from '@angular/core'; import { Type, ɵDirectiveDef as _DirectiveDef, OnDestroy } from '@angular/core'; import { Writable } from '@ngx-cocktail/common'; export { Features } from '@ngx-cocktail/common'; import * as rxjs from 'rxjs'; import { Observable } from 'rxjs'; declare function DestroyableFeature(): <T extends Type<unknown>>(directiveDef: Writable<_DirectiveDef<T>>) => void; interface Destroyable extends Partial<OnDestroy> { readonly destroyed$: Observable<unknown>; ngOnDestroy?(): void; } declare const destroySubject: unique symbol; declare abstract class Destroyed implements Destroyable { private readonly [destroySubject]; readonly destroyed$: rxjs.Observable<unknown>; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<Destroyed, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<Destroyed, never, never, {}, {}, never, never, true, never>; } export { DestroyableFeature, Destroyed }; export type { Destroyable };