https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

adeln

03/04/2017, 12:25 PM
can I do better than this ?
Copy code
sub += rxObservable(EmptyCoroutineContext) {
  for (c in RxView.clicks(h.logout).open()) {
    val db = Singletons.db

    (CronScheduling.cancelAll(db, ctx) + db.clearDatabase())
        .subscribeOn(<http://Schedulers.io|Schedulers.io>())
        .awaitSingle()

    send(Preferences.clearPrefsOnLogout())
  }
}.subscribe()