Last active
February 27, 2020 06:30
-
-
Save ramunasjurgilas/aea0e3b4ee359d4af2f9aaf5d0e42f12 to your computer and use it in GitHub Desktop.
ignoreOutput() 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
(1...2000) | |
.publisher | |
.ignoreOutput() | |
.sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) | |
// Output: | |
finished | |
// Without ignoreOutput | |
(1...3) | |
.publisher | |
.sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) | |
// Output: | |
// 1 | |
// 2 | |
// 3 | |
// finished |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment