Skip to content

Instantly share code, notes, and snippets.

View a2en's full-sized avatar
🎯
Focusing

Ameen Ahsan a2en

🎯
Focusing
View GitHub Profile
@a2en
a2en / DebounceTest.kt
Created November 4, 2020 09:27 — forked from k-kagurazaka/DebounceTest.kt
RxJava debounce like operator implementation for kotlin coroutine
launch(UI) {
editText.onTextChanged()
.debounce(1, TimeUnit.SECONDS)
.consumeEach {
Log.d("DebounceTest", "value: $it")
}
}
}
fun EditText.onTextChanged(): ReceiveChannel<String> =