@lifaon/rx-js-light
Version:
Blazing fast Observables
9 lines (8 loc) • 575 B
TypeScript
import { IUnsubscribe } from '../../observable/type/observable.type';
export declare const DEFAULT_ON_ERROR_FOR_ASYNC_UNSUBSCRIBE: (error: any) => never;
/**
* Try to unsubscribe immediately. If it fails, await next event loop to unsubscribe
* INFO: this is useful to unsubscribe before the unsubscribe function is even assigned
*/
export declare function asyncUnsubscribe(getUnsubscribe: () => IUnsubscribe, onSuccess?: () => void, onError?: (error: any) => void): void;
export declare function asyncUnsubscribePromise(getUnsubscribe: () => IUnsubscribe): Promise<void>;