Skip to content

Context receiver APIs #370

Description

@ZacSweers

If compound extensions do make their way into Kotlin, we could leverage them nicely in AutoDispose to do something like this:

fun <T> ScopeProvider.Observable<T>.autoDispose() {
  // ...
}

fun test(scope: ScopeProvider) = scope.apply {
  myObservable
      .autoDisposable()
      .subscribe()
}

// or

class Worker : ScopeProvider {
  fun run() {
    workObservable
        .autoDisposable()
        .subscribe()
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions