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

OR-5259 FilteringOperators:: Limiting values #93

Merged
merged 1 commit into from
Jul 9, 2023

Conversation

crazymanish
Copy link
Owner

Context

Operators are publishers

  • In Combine, methods that perform an operation on values coming from a publisher are called operators.
  • Each Combine operator actually returns a publisher. Generally speaking, that publisher receives the upstream values, manipulates the data, and then sends that data downstream.

In this PR

  • Limiting values means receiving values until some condition is met, and then forcing the publisher to complete.
  • For example, consider a request that may emit an unknown amount of values, but you only want a single emission and don’t care about the rest of them.
  • Combine solves this set of problems with the prefix family of operators.
  • This is opposite of dropping values operators: drop(), drop(while:), drop(:untilOutputFrom)

@crazymanish crazymanish requested review from buh and raihan July 9, 2023 19:03
@crazymanish crazymanish linked an issue Jul 9, 2023 that may be closed by this pull request
@crazymanish crazymanish merged commit e684671 into main Jul 9, 2023
@crazymanish crazymanish deleted the OR-5259-filtering-operators-limiting-values branch July 9, 2023 19:03
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.

[w21(21may-27may)] Operators:: Filtering Operators: Limiting values
1 participant