Created
February 27, 2020 06:46
-
-
Save ramunasjurgilas/aefec43144ba58cf5a49b7f58e52267a to your computer and use it in GitHub Desktop.
first() as filtering operator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["a", "b", "c", "a"] | |
.publisher | |
.first(where: { $0 == "a" }) | |
.sink { print($0) } | |
// Output: | |
// a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment