UNPKG

container.ts

Version:
21 lines (20 loc) 1.07 kB
import { BehaviorSubject, Observable, Subject } from "rxjs"; import { IModuleDestroy, IModuleHook, IModuleOptions, Module } from "./module"; /** Module class with RxJS unsubscribe and state for usability. */ export declare class RxModule<S = object> extends Module { /** Default module name. */ static readonly moduleName: string; /** Observable state with takeUntil, filter pipe applied. */ readonly rxState$: Observable<S>; /** Internal observable subscription management. */ protected readonly rxUnsubscribe$: Subject<void>; /** Internal observable state management. */ protected readonly rxStateRaw$: BehaviorSubject<S>; constructor(options: IModuleOptions); moduleDown(...args: IModuleHook[]): Promise<void>; moduleDestroy(...args: IModuleDestroy[]): void; /** Utility method for piping observable through takeUntil. */ rxTakeUntilModuleDown<T>(observable$: Observable<T>): Observable<T>; /** Utility method for updating internal observable state. */ rxStateUpdate(value: Partial<S>): Observable<S>; }