UNPKG

446 BTypeScriptView Raw
1import { IDisposer } from "./utils";
2export interface IResource<T> {
3 current(): T;
4 dispose(): void;
5 isAlive(): boolean;
6}
7export declare function fromResource<T>(subscriber: (sink: (newValue: T) => void) => void, unsubscriber?: IDisposer): IResource<T | undefined>;
8export declare function fromResource<T>(subscriber: (sink: (newValue: T) => void) => void, unsubscriber: IDisposer | undefined, initialValue: T): IResource<T>;