/rx-tasks

Simple and lightweight RxJava2 wrapper for the GMS Tasks API

Primary LanguageKotlinApache License 2.0Apache-2.0

Android RxTasks

Build Status Coverage Download License

Simple and lightweight RxJava2 wrapper for the GMS Tasks API https://developers.google.com/android/reference/com/google/android/gms/tasks/package-summary

Description

RxTasks is a lightweight wrapper for the GMS Tasks API, more commonly recognised when using asynchronous results from Firebase requests.

Typically the Tasks API would allow you to add listeners that may be scoped to an activity or executor, however this is not needed since scheduling and Disposable's are handled by the user.

Please note that this library uses RxJava2 so calls must respect Completable and Single chains.

Usage

Import to your project with the following statement:

    compile 'io.ashdavies.rx:rx-tasks:{latest-version}'

Any Task returned from the Google Mobile Services API can simply be wrapped in the appropriate call using an extension function.

    Single<AuthResult> result = FirebaseAuth.getInstance()
      .signInAnonymously()
      .toSingle()