Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(type-definitions): Constrain this type, add awaitPromises alias #475

Merged
merged 1 commit into from
Aug 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions type-definitions/most.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ export interface Stream<A> extends Source<A> {
timestamp(): Stream<TimeValue<A>>;
delay(dt: number): Stream<A>;

// Note: Without higher-kinded types, this type cannot be written properly
await<B>(): Stream<B>;
await<B>(this: Stream<Promise<B>>): Stream<B>;
awaitPromises<B>(this: Stream<Promise<B>>): Stream<B>;

sample<B, C, R>(
fn: (b: B, c: C) => R,
Expand Down Expand Up @@ -340,6 +340,7 @@ export function delay<A>(dt: number, s: Stream<A>): Stream<A>;

export function fromPromise<A>(p: Promise<A>): Stream<A>;
export function await<A>(s: Stream<Promise<A>>): Stream<A>;
export function awaitPromises<A>(s: Stream<Promise<A>>): Stream<A>;

export function sample<A, B, R>(
fn: (a: A, b: B) => R,
Expand Down