Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Last active May 8, 2020 08:37
Show Gist options
  • Save markchristopherng/687901f1e249f7578176b2d34e9ff1a7 to your computer and use it in GitHub Desktop.
Save markchristopherng/687901f1e249f7578176b2d34e9ff1a7 to your computer and use it in GitHub Desktop.
private fun loadAppConfig() {
appConfigManager.getAppConfig(pushNotificationManager.deviceId)
.prodTimeout(2500, TimeUnit.MILLISECONDS)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.`as`(AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(lifecycle, Lifecycle.Event.ON_DESTROY)))
.subscribe({ appConfig -> processAppConfig(appConfig) },
{ throwable -> Timber.e(throwable) })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment