Hi! Is this possible to add own extension method t...
# android
a
Hi! Is this possible to add own extension method to
RxView
from RxBinding ? (I got unresolved reference)
Copy code
fun RxView.throttledClick(v: View, s: () -> Any) {
        this.clicks(v).throttleFirst(1000, TimeUnit.MILLISECONDS).subscribe{s()}
    }
I tried to look deeper
Copy code
@CheckResult
inline fun View.clicks(): Observable<Unit> = RxView.clicks(this).map(VoidToUnit)
But I am still confused why I can't just add extension method. (I am still new to kotlin)
e
RxView itself does not have instance, it just provide a brunch of static methods. Extension method is applied to the instance of the class and not the class itself.
👍 2
a
thanks!