-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From AnyObserver to RxCocoa.Binding #4
Conversation
The protocol extension contains the same implementation: https://github.com/ReactiveX/RxSwift/blob/ba41245d067af562c6e61b9439ea1686c1fb60ad/RxSwift/Reactive.swift#L60-L68
Thanks a lot for contributing @kasyanov-ms! I've invited you to join the Generated by 🚫 dangerJS |
If PR is Ok, I'll update the changelog and examples |
Thanks @kasyanov-ms. What's the up-side of switching from AnyObserver to Binder in this case? Especially given the fact Binder is just a wrapper for AnyObserver? |
Hello. |
This is really interesting. I would imagine the Anyways, looks good to me! Thank you. |
Thanks for your contribution, and welcome to RxSwiftCommunity! |
Yeap, it was possible to achieve the same with |
PR makes a binding implementation similar to UIImageView extension
The basic usage is:
But there is still one design issue. Since we cannot bind
Observable<URL>
toBinding<Resource>
, the current workaround isBinding<URL?>
return type. The other choices:Binding<Resource?>
. The same element type as in the current version. The drawback is repeatingmap { $0 as Resource? }
typecastingResource
andURL
bindings. Code duplicating