This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface HasDisposables { | |
fun Disposable.autoDispose() | |
fun dispose() | |
companion object { | |
operator fun invoke(): HasDisposables = object : HasDisposables { | |
private val disposables = CompositeDisposable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
launch(UI) { | |
editText.onTextChanged() | |
.debounce(1, TimeUnit.SECONDS) | |
.consumeEach { | |
Log.d("DebounceTest", "value: $it") | |
} | |
} | |
} | |
fun EditText.onTextChanged(): ReceiveChannel<String> = |