Created
January 30, 2020 08:13
-
-
Save ramunasjurgilas/1beb2e740c339d2dd2e32d42a9bedc0c to your computer and use it in GitHub Desktop.
collect() as transforming 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
["L", "I", "E", "T", "U", "S", "!"] | |
.publisher.collect().sink { | |
print($0) | |
} | |
// Output: ["L", "I", "E", "T", "U", "S", "!"] | |
["L", "I", "E", "T", "U", "S", "!"] | |
.publisher.collect(4).sink { | |
print($0) | |
} | |
// Output: | |
// ["L", "I", "E", "T"] | |
// ["U", "S", "!"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment