Rx Tasks

Additional

Language
Kotlin
Version
N/A
Created
Jan 4, 2017
Updated
Feb 23, 2018
Owner
Ash Davies (ashdavies)
Contributors
Josh Burton (athornz)
tbsandee
Ash Davies (ashdavies)
3
Activity
Badge
Generate
Download
Source code
APK file

Show card

Android RxTasks

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()