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 Nov 14, 2018. It is now read-only.
Sometimes it's tedious to call a post method on some View object, and then access this object again inside the braces, especially with databinding. For example:
My general problem with this is that the majority of APIs accepting some kind of callback or lambda do not provide the enclosing instance and we would have to apply this trick to all of them.
The traditional Kotlin pattern for solving this is to create a scope with the instance you want to re-use with let:
Good point, also with is a good candidate for this. Just thought that the post is the most usable thing, which could've had such an extension to ease the usage for those, who is not aware of scoping functions/doesn't want to use them for reasons.
Sometimes it's tedious to call a
post
method on someView
object, and then access this object again inside the braces, especially with databinding. For example:If we'd have a following extension, it could make it a little bit easier:
The text was updated successfully, but these errors were encountered: