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
Stream.zip
3.6.0
import { Effect, Stream } from "effect" const stream = Stream.make(1, 2, 3).pipe( Stream.broadcast(3, 10), Stream.map(([s1, s2, s3]) => ({ n1: s1, n2: s2.pipe(Stream.map((v) => v * 2)), n3: s2.pipe(Stream.map((v) => v * 3)), })), Stream.flatMap(({ n1, n2, n3 }) => Stream.zip(n1, n2, n3), // TYPESCRIPT REPORTS: Expected 1-2 arguments, but got 3. ts (2554) [11, 22] ), ) Effect.runPromise(Stream.runCollect(stream)).then(console.log)
Passing more than 2 streams to Stream.zip works per documentation :
Zipping is a process of combining two or more streams to create a new stream by pairing elements from the input streams.
Expected 1-2 arguments, but got 3. ts (2554) [11, 22]
when passing more than 2 streams to Stream.zip
No response
The text was updated successfully, but these errors were encountered:
Here"s workaround using Effect.all:
Effect.all
import { Effect, Stream } from "effect" const stream = Stream.make(1, 2, 3).pipe( Stream.mapEffect((v) => Effect.all( { n1: Effect.succeed(v), n2: Effect.succeed(v * 2), n3: Effect.succeed(v * 3), }, { concurrency: "unbounded" }, ), ), ) Effect.runPromise(Stream.runCollect(stream)).then(console.log)
Unfortunately, this makes consuming stream slower because it has to wait for all effects to finalize for each element.
Sorry, something went wrong.
Seems like we are missing a Stream.all
Stream.all
No branches or pull requests
What version of Effect is running?
3.6.0
What steps can reproduce the bug?
What is the expected behavior?
Passing more than 2 streams to
Stream.zip
works per documentation :What do you see instead?
when passing more than 2 streams to
Stream.zip
Additional information
No response
The text was updated successfully, but these errors were encountered: