livedata-ktx icon indicating copy to clipboard operation
livedata-ktx copied to clipboard

debounce() uses Handler which makes it difficult to test

Open bkolarov opened this issue 5 years ago • 0 comments

The LiveData<T>.debounce(delayMillis: Long) extension relies on the Handler class, which makes view models difficult to test without Robolectric.

A possible solution is to wrap Handler with an interface and provide an API for overriding the default implementation. Something similar to RxJavaPlugins

bkolarov avatar Feb 03 '20 11:02 bkolarov