Skip to content

Instantly share code, notes, and snippets.

@nhphong
Created July 20, 2019 03:51
Show Gist options
  • Save nhphong/aedfd3cbd6d300758a9eb01ca257fb0e to your computer and use it in GitHub Desktop.
Save nhphong/aedfd3cbd6d300758a9eb01ca257fb0e to your computer and use it in GitHub Desktop.
val scheduler = TestScheduler()
val source = Observable.just(1)
.doOnSubscribe {
println("Hello World")
}
source
.debounceIf({ it == 1 }, 2, SECONDS, scheduler)
.test()
scheduler.advanceTimeBy(2, SECONDS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment