Skip to content

feat: Add .merge() higher-order method - #57

Merged
giraugh merged 9 commits into
mainfrom
feat/merge-streams
Oct 17, 2025
Merged

feat: Add .merge() higher-order method#57
giraugh merged 9 commits into
mainfrom
feat/merge-streams

Conversation

@giraugh

@giraugh giraugh commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Adds a .merge() method which is similiar to .flatten() in that it converts a "higher order" stream of streams into just a standard stream. However, this method will emit all the nested atoms in whatever order they emit in, rather than ordered by the inner streams in the outer stream.

In particular, both the nested atoms and the atoms of the higher-order stream are raced in parallel. So a high-order stream with a delay will also emit as expected. (This was quite tricky in practice haha)

@giraugh
giraugh requested a review from mdboon October 16, 2025 06:27
@giraugh giraugh self-assigned this Oct 16, 2025
@giraugh giraugh added the enhancement New feature or request label Oct 16, 2025
@changeset-bot

changeset-bot Bot commented Oct 16, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 92d351d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
windpipe Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread src/stream/higher-order.ts Outdated
Comment thread src/stream/higher-order.ts Outdated
Comment thread src/stream/higher-order.ts Outdated
giraugh and others added 4 commits October 17, 2025 10:42
@giraugh
giraugh merged commit 8b46a0d into main Oct 17, 2025
1 check passed
@giraugh
giraugh deleted the feat/merge-streams branch October 17, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants