diff --git a/docs/api.md b/docs/api.md index 24f61d53..a7f8a633 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1311,7 +1311,7 @@ See [combine](#combine) for more details. #### `sampler.sample(f, ...streams) -> Stream` #### `most.sample(f, sampler, ...streams) -> Stream` -Create a new stream by combining sampled values from many input streams. +Create a new stream by combining sampled values from one or more input streams. ``` s1: -1-----2-----3-> diff --git a/type-definitions/most.d.ts b/type-definitions/most.d.ts index a8db93a8..316029b0 100644 --- a/type-definitions/most.d.ts +++ b/type-definitions/most.d.ts @@ -160,6 +160,10 @@ export interface Stream extends Source { await(this: Stream>): Stream; awaitPromises(this: Stream>): Stream; + sample( + fn: (b: B) => R, + b: Stream, + ): Stream; sample( fn: (b: B, c: C) => R, b: Stream, @@ -339,6 +343,11 @@ export function fromPromise(p: Promise): Stream; export function await(s: Stream>): Stream; export function awaitPromises(s: Stream>): Stream; +export function sample( + fn: (a: A) => R, + sampler: Stream, + a: Stream, +): Stream; export function sample( fn: (a: A, b: B) => R, sampler: Stream,