Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Combine
- extension Publisher where Failure == Never {
- func optionalAssign<Root>(to keyPath: ReferenceWritableKeyPath<Root, Optional<Output>>,
- on: Root) -> AnyCancellable {
- map{let output:Output? = $0;return output}
- .assign(to: keyPath, on: on)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement