Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import Combine
  2. extension Publisher where Failure == Never {
  3. func optionalAssign<Root>(to keyPath: ReferenceWritableKeyPath<Root, Optional<Output>>,
  4. on: Root) -> AnyCancellable {
  5. map{let output:Output? = $0;return output}
  6. .assign(to: keyPath, on: on)
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement