Skip to content

Instantly share code, notes, and snippets.

@Alexander-Ignition
Created April 18, 2020 07:29
Show Gist options
  • Save Alexander-Ignition/3e6910fe8d67d1a0dc8db33d0a968785 to your computer and use it in GitHub Desktop.
Save Alexander-Ignition/3e6910fe8d67d1a0dc8db33d0a968785 to your computer and use it in GitHub Desktop.
Optional+Combine
[1, 2].publisher // Publishers.Sequence<[Int], Never>
Result<Int, Never>.success(1).publisher // Result<Int, Never>.Publisher
Optinal.some(1).publisher // Error! But have Optional.Publisher
// Missing extention
extension Optional {
public var publisher: Optional.Publisher {
Optional.Publisher(self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment