-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
OperatorWeakBinding to not use WeakReferences anymore #1021
OperatorWeakBinding to not use WeakReferences anymore #1021
Conversation
RxJava-pull-requests #944 FAILURE |
@samueltardieu @tehmou @zsxwing @mironov-nsk Could you guys check this out? The discussion is in #1008 |
I think this is a good compromise:
I am in favor of applying it. |
I like this. I was already handling subscriptions in a superclass so the weak reference thing seemed unnecessary. I'd prefer it this way. |
I followed both discussion #1008 and this one and for me this is still unclear. @mttkay I was wondering if you don't mine telling if
|
Hi Nicolas, ad u2020: ad bindActivity/bindFragment. bindActivity: schedules the observable's notifications on the main UI bindFragment: same, just that the predicate here not only tests for the Does that make sense? |
@mttkay thanks a lot for this detailed answer. bindActivity bindFragment make sense. |
So does this mean |
@@ -24,88 +21,71 @@ | |||
|
|||
private static final String LOG_TAG = "WeakBinding"; | |||
|
|||
final WeakReference<R> boundRef; | |||
private R boundRef; | |||
private final Func1<? super R, Boolean> predicate; | |||
|
|||
public OperatorWeakBinding(R bound, Func1<? super R, Boolean> predicate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small suggestion. Since WeakReference
is removed, I feel we need a new name rather than OperatorWeakBinding
.
No. Actually the |
Agree @zsxwing on the naming aspect. How about |
+1, |
Looks like this is still in progress ... @mttkay please let me know when this is ready for merging. |
RxJava-pull-requests #951 SUCCESS |
Having it in onViewCreated is fine, but misleading, since we don't need to reattach retained fragments. (the referenced object remains the same.)
@benjchristensen this is good to go. |
RxJava-pull-requests #952 SUCCESS |
Thanks @mttkay |
OperatorWeakBinding to not use WeakReferences anymore
related issues:
#1008
#1006
#979
I changed the samples to actually use
bindActivity
andbindFragment