-
Notifications
You must be signed in to change notification settings - Fork 966
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
RxView.bindView(View view, Observable<T> source) #70
Comments
This library is for property and event binding only. That method was an analogous to the poorly-named Once view attach/detach events are added you'll be able to use this library to compose operators to a functionally-equivalent solution along the lines of: Observable.interval(500, MILLISECONDS)
.takeUntil(RxView.attachEvents(myView).filter(e -> e.kind() == DETACH))
.subscribe(/* do something with myView */); This can easily be abstracted into a static helper method of the same signature as the |
I really like the view attach/detach event solution! Are these events planned for the near future? |
Yep. They're on my list (which I should probably move to GitHub issues). |
Talked with @dlew and he agreed it fits within the scope of RxLifecycle, pull request here: trello-archive/RxLifecycle#12 |
On a related note, some of the event names/usage overlap (like attach/detach). @JakeWharton @dlew any interest in maybe consolidating these in some way so users don't end up with duplicates? |
Even better! On Thu, Aug 6, 2015 at 8:50 PM Henri (Zac) Sweers notifications@github.com
|
As brought up in JakeWharton#70
API in Observable.interval(500, MILLISECONDS)
.takeUntil(RxView.detaches(myView))
.subscribe(/* do something with myView */); |
When I updated to RxAndroid 1.0.0 I missed
ViewObservable.bindView(View view, Observable<T> source)
. Will it be added here? Is there another way I'm not seeing to replace this API?https://github.com/ReactiveX/RxAndroid/blob/4bff437edfa24dde62c90d44b019b9a35855db6a/rxandroid/src/main/java/rx/android/view/ViewObservable.java
I often used a combination of this to attach observables to items in my adapters.
Manually unsubscribing looks like unnecessary extra effort.
The text was updated successfully, but these errors were encountered: