For such cases, I usually do something like this: ...
# coroutines
c
For such cases, I usually do something like this:
Copy code
var delayedJob: Job? = null

fun onEvent() {
  delayedJob?.cancel()
  delayedJob = launch {
    delay(1000)
    // Do stuff
  }
}
n
thats what i came up with as well, pretty much exactly the same
c
It's simple and it works, so good enough for my use cases