Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created May 8, 2020 08:30
Show Gist options
  • Save markchristopherng/bb34bae37e142d3156b528d444928180 to your computer and use it in GitHub Desktop.
Save markchristopherng/bb34bae37e142d3156b528d444928180 to your computer and use it in GitHub Desktop.
fun <T> Observable<T>.prodTimeout(timeout: Long, timeUnit: TimeUnit): Observable<T> {
return if (BuildConfig.BUILD_TYPE == "debug" || timeout == 0L) {
this
} else {
this.timeout(timeout, timeUnit)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment