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

feat: implement orElse operator #47

Merged
merged 1 commit into from
Nov 6, 2023
Merged

feat: implement orElse operator #47

merged 1 commit into from
Nov 6, 2023

Conversation

geminicaprograms
Copy link
Contributor

If a source has no elements then elements from an alternative source are emitted to the returned channel. If this source is failed then failure is passed to the returned channel.

Examples:

  Source.fromValues(1).orElse(Source.fromValues(2, 3)).toList // List(1)
  Source.empty.orElse(Source.fromValues(2, 3)).toList         // List(2, 3)

Closes #37.

If a source has no elements then elements from an `alternative` source
are emitted to the returned channel. If this source is failed then failure
is passed to the returned channel.

Examples:

  Source.fromValues(1).orElse(Source.fromValues(2, 3)).toList // List(1)
  Source.empty.orElse(Source.fromValues(2, 3)).toList         // List(2, 3)

Closes #37.
@geminicaprograms geminicaprograms merged commit 6469bd0 into master Nov 6, 2023
4 checks passed
@geminicaprograms geminicaprograms deleted the feat_orElse branch November 6, 2023 07:10
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

Successfully merging this pull request may close these issues.

Add orElse operator
3 participants