Skip to content
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

Merging two or more streams with merge-stream #2

Open
DarkenLM opened this issue Feb 15, 2021 · 7 comments
Open

Merging two or more streams with merge-stream #2

DarkenLM opened this issue Feb 15, 2021 · 7 comments

Comments

@DarkenLM
Copy link

So after looking at your code, if you want to join multiple streams, this code might work:

function joinStreams(streams) {
  let merged = mergeStream()
  for (let i in streams) {
    merged.add(streams[i])
  }
  return merged
}

let merged = joinStreams(stream1, stream2, ...)
@rowisahub
Copy link
Owner

let merged = joinStreams(stream1, stream2, ...)

My question, does this work even with new stream? Like if someone joins later in the call can i call this function again? And if i can, how?

@DarkenLM
Copy link
Author

let merged = joinStreams(stream1, stream2, ...)

...

let merged2 = joinStreams(merged, stream1)

Let me know it it works.

@rowisahub
Copy link
Owner

Ok, i will try later. Thanks

@rowisahub
Copy link
Owner

but doesn't that just overlap each other and basically stop 1 stream going over the other?

@rowisahub
Copy link
Owner

and how would i remove a stream?

@Weppman
Copy link

Weppman commented Jul 26, 2021

Did you ever get this working

@Jiron
Copy link

Jiron commented Mar 10, 2023

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants