@flywine93/ngx-autounsubscrb
Version:
Angular 9+ automatically unsubscribe to the RXJS decorator, It is lightweight and practical!!
22 lines (21 loc) • 695 B
TypeScript
export interface Options {
blackList?: string[];
checkArrVar?: boolean;
}
/**
* unsubscribe variable
* @param member public and private member or temp variable
*/
export declare function unsubscribe(variable: any, options: Options): void;
/**
* unsubscribe member variable and temp variable when destroy.
* @param options options
* 1.blackList---Variables in blacklist are not cancelled
*/
export declare function AutoUnsubscrb(options?: Options): (target: any) => void;
/**
* Manually add temporary variables and unsubscribe when destroy.
* @param target Class this keyword
* @param subscrb Temp variable
*/
export declare function MAutoAdd(target: any, subscrb: any): void;