Introduce xs.merge type declaration #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support type declarations when calling
xs.merge()
. This change allows consumers to leverage TypeScript to verify type safety when merging streams. It also bringsmerge
in line with other static methods which already support this feature.Description
Modify static
merge
method to implement a new interface: MergeSignature. This interface is constructed similarly to the CombineSignature interface. Export the new interface.There are two areas I think merit discussion.
First: I'm not exactly sure what the intended behavior of this method is when called without arguments. The interface says a stream is returned that emits items of any type. And I suppose that's true. However, when I call this without any arguments, I get a stream that doesn't emit anything ever (or complete). Obviously my fault as the caller, but perhaps we want to do something else when it's called without arguments.
Second: I don't know how to test this or if it deserves a test. I imported core into a test file and was able to get type support for the method.
Motivation and Context
This should resolve #80.
Checklist: