Skip to content

Instantly share code, notes, and snippets.

@nhphong
Created July 20, 2019 04:02
Show Gist options
  • Save nhphong/51b192603b9d27c2869d4a4b6b807f2b to your computer and use it in GitHub Desktop.
Save nhphong/51b192603b9d27c2869d4a4b6b807f2b 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