Skip to content

Instantly share code, notes, and snippets.

@ramunasjurgilas
Created February 27, 2020 06:46
Show Gist options
  • Save ramunasjurgilas/aefec43144ba58cf5a49b7f58e52267a to your computer and use it in GitHub Desktop.
Save ramunasjurgilas/aefec43144ba58cf5a49b7f58e52267a to your computer and use it in GitHub Desktop.
first() as filtering operator
["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