Last active
January 30, 2020 08:29
-
-
Save ramunasjurgilas/4130e65d7f103ae1cb2787403b46c6ab to your computer and use it in GitHub Desktop.
map() 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
["1", "2", "w", "3"] | |
.publisher.map { | |
Int($0) | |
} | |
.sink { | |
print($0) | |
} | |
// Output: | |
//Optional(1) | |
//Optional(2) | |
//nil | |
//Optional(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment