Skip to content

Instantly share code, notes, and snippets.

@ramunasjurgilas
Last active January 30, 2020 08:29
Show Gist options
  • Save ramunasjurgilas/4130e65d7f103ae1cb2787403b46c6ab to your computer and use it in GitHub Desktop.
Save ramunasjurgilas/4130e65d7f103ae1cb2787403b46c6ab to your computer and use it in GitHub Desktop.
map() as transforming operator
["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