Skip to content

Instantly share code, notes, and snippets.

@ramunasjurgilas
Created February 27, 2020 06:57
Show Gist options
  • Save ramunasjurgilas/289005a441c10b38f49629ec2e9b1b66 to your computer and use it in GitHub Desktop.
Save ramunasjurgilas/289005a441c10b38f49629ec2e9b1b66 to your computer and use it in GitHub Desktop.
Combine: last() as filtering operator
["a1", "b2", "c3", "b4", "a5"]
.publisher
.last(where: { $0.hasPrefix("b") })
.sink { print($0) }
// Output:
// b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment