-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mergeMapConcurrently
type definition
#288
Add mergeMapConcurrently
type definition
#288
Conversation
Hey @gitusp thank you for taking the time to open this PR! I have a few small comments that I think will make these definitions ready for everyone.
export function mergeMapConcurrently<A, B>(f: (a: A) => Stream<B>): {
(concurrency: number, s: Stream<A>) => Stream<B>
(concurrency: number): (s: Stream<A>) => Stream<B>
} This will allow TypeScript to follow the overloads like a tree structure and allow all valid use of the function. |
It fixes `mergeMapConcurrently`'s type definitions to accept various forms of calling curried function. It applies the following reviews: - mostjs#288 (comment) - mostjs#288 (comment)
Thanks so much @TylorS and @briancavalier! I played around @TylorS's examples and confirmed what you mentioned. That was really good to know. I ported @briancavalier's new flow defs into TypeScript and confirmed that the new definitions works on all the forms of partial application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good. Thanks!
mergeMapConcurrently
seems to be missing its type definition.I have checked that copying-and-pasting these definitions into my project's
node_modules/@most/core/type-definitions/combinator/mergeConcurrently.d.ts
seemed suggest types as documented, but not tested seriously.