Open ZacSweers opened 5 years ago
Note: this would supersede the need for #375
Closing this as it seems like it's not moving anywhere
context receivers are happening
Should be a very simple function:
// Original function
@CheckReturnValue
inline fun <T> Observable<T>.autoDispose(provider: ScopeProvider): ObservableSubscribeProxy<T> =
this.`as`(AutoDispose.autoDisposable(provider))
// Context receivers function
context(ScopeProvider)
inline fun <T> Observable<T>.autoDispose(): ObservableSubscribeProxy<T> = autoDispose(this@ScopeProvider)
If compound extensions do make their way into Kotlin, we could leverage them nicely in AutoDispose to do something like this: