import { OnDestroy } from '@angular/core'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; /** * Extend this when need to handle subscriptions clean up or side-effects * * ```ts * @Component({ * selector: "app-color-text", * template: `{{ color }}`, * changeDetection: ChangeDetectionStrategy.OnPush, * }) * class ColorTextComponent extends SubscribeSink { * @Input() color: string; * * color$ = this.getInput$("color"); * * constructor() { * super(); * * const someOtherObservable$ = this.color$.pipe(...); * * // no need to worry about unsubscribing. It'll be done automatically * this.subscribeTo(someOtherObservable$); * } * * performMyAction = this.createEffect((action$) => * action$.pipe( * switchMap((action) => api.post(action)) * ) * ); * } */ export declare class SubscribeSink implements OnDestroy { private destroy$$; destroy$: Observable; createEffect(factoryFn: (source: Observable) => Observable): (value: T) => void; subscribeTo(source: Observable): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare function createEffectFn(factoryFn: (source: Observable) => Observable): (destroyed$: Observable) => (value: T) => void;