There is a more elegant way to call this than ressing it to a variable?
public fun<T> Function1<Subscriber<in T>, Unit>.asObservable(): Observable<T> {
val v = this
return Observable.create(object:OnSubscribe<T> {
override fun call(t1: Subscriber<in T>?) {
v(t1!!)
}
})!!
}
Cheers!