You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
Sometimes we are using viewOrThrow.doSmthWithTheView() to send directly something to the view.
This is useful if we get a callback from the View (in a onclicklistener) for example.
So we don't have to say sendToView { it.doSmthWithTheView() }.
But sometimes we refactore code and oversee se viewOrThrow which should be wrapped into sendToView{}.
For that it would be great if we have annotation like @ViewAttached over the method which says that these method should be only called if a view is attached.
With that we can make sure, that we can safely call viewOrThrow. instead of sendToView{}.
What do you think?
The text was updated successfully, but these errors were encountered:
I think it's a nice idea. But keep in mind that sendToView() must be used to wrap any call to a view method if it's called from a lengthy asynchronous operation that might outlive the lifecycle. But there might be view methods that are called in response to an ui event (which implies that a view currently exists) and in response to a lengthy asynchronous operation. Just adding an annotation to the view method would mean that we get warnings in places where sendToView() is not necessarily required. 🤔
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Sometimes we are using
viewOrThrow.doSmthWithTheView()
to send directly something to the view.This is useful if we get a callback from the View (in a onclicklistener) for example.
So we don't have to say
sendToView { it.doSmthWithTheView() }
.But sometimes we refactore code and oversee se
viewOrThrow
which should be wrapped intosendToView{}
.For that it would be great if we have annotation like
@ViewAttached
over the method which says that these method should be only called if a view is attached.With that we can make sure, that we can safely call
viewOrThrow.
instead ofsendToView{}
.What do you think?
The text was updated successfully, but these errors were encountered: