We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
Using Typescript 1.8.7,
I have stream.map(fnThatReturnsAStreamOfBooleans). That properly get inferred to Stream<Stream<boolean>>
stream.map(fnThatReturnsAStreamOfBooleans)
Stream<Stream<boolean>>
However, if I finish the chain with flatten(), the final type is Stream<{}> instead of Stream<boolean>
Stream<{}>
Stream<boolean>
Example:
const stream: Stream<string> = Stream.create({ start: listener => {}, stop: () => {} }) const stream2: Stream<boolean> = Stream.create({ start: listener => {}, stop: () => {} }) const f = stream.map(x => stream2).flatten() f is a stream<{}>
I suspect the T in flatten completely redefines the T of the Stream.
T
I think it would be best to remove this whole T extends Stream<R> for now.
T extends Stream<R>
PS: this seems to be related: microsoft/TypeScript#1290
Arguably, this shows a single operation flatMap is not such a bad idea after all :p
The text was updated successfully, but these errors were encountered:
Thanks for the report
Sorry, something went wrong.
test(flatten): add TypeScript test for flattening
c84dc18
An attempt at reproducing bug #4.
fix(flatten): fix TypeScript output type
26f2241
Fix issue #4.
fix(flattenConcurrently): fix TypeScript output type
b5445a5
Fixed in 2.1.0
No branches or pull requests
Hello,
Using Typescript 1.8.7,
I have
stream.map(fnThatReturnsAStreamOfBooleans)
. That properly get inferred toStream<Stream<boolean>>
However, if I finish the chain with flatten(), the final type is
Stream<{}>
instead ofStream<boolean>
Example:
I suspect the
T
in flatten completely redefines theT
of the Stream.I think it would be best to remove this whole
T extends Stream<R>
for now.PS: this seems to be related: microsoft/TypeScript#1290
Arguably, this shows a single operation flatMap is not such a bad idea after all :p
The text was updated successfully, but these errors were encountered: