UNPKG

@thi.ng/rstream

Version:

Reactive streams & subscription primitives for constructing dataflow graphs / pipelines

20 lines 683 B
import { type MetaStreamOpts } from "./metastream.js"; /** * Returns a subscription which buffers any intermediate inputs arriving faster * than given `delay` time period, then emits last received value after `delay` * milliseconds. * * @example * ```ts tangle:../export/debounce.ts * import { debounce, fromIterable, trace } from "@thi.ng/rstream"; * * const src = fromIterable([1, 2, 3], { delay: 10 }) * src.subscribe(debounce(20)).subscribe(trace()); * // 3 * // done * ``` * * @param delay - */ export declare const debounce: <T>(delay: number, opts?: Partial<MetaStreamOpts>) => import("./metastream.js").MetaStream<T, T>; //# sourceMappingURL=debounce.d.ts.map