UNPKG

@most/disposable

Version:

Reactive programming with lean, functions-only, curried, tree-shakeable API

12 lines (11 loc) 392 B
import { Disposable } from '@most/types'; export interface DisposeWith { (): DisposeWith; <R>(dispose: (resource: R) => void): (resource: R) => Disposable; <R>(dispose: (resource: R) => void, resource: R): Disposable; } /** * Create a Disposable that will use the provided * dispose function to dispose the resource */ export declare const disposeWith: DisposeWith;