Class Debouncer
-
-
Method Summary
Modifier and Type Method Description final Unitsubmit(Function0<Unit> work)Cancels the previous work and launches a new coroutine containing the new work. final UnitsubmitSuspendable(SuspendFunction0<Unit> work)Cancels the previous work and launches a new coroutine containing the new suspendable work. final UnitcancelLastDebounce()Cancels the current work without shutting down the Coroutine scope. final Unitshutdown()Cleans up any pending work. -
-
Constructor Detail
-
Debouncer
Debouncer(Long debounceMs, CoroutineScope scope)
-
-
Method Detail
-
submit
final Unit submit(Function0<Unit> work)
Cancels the previous work and launches a new coroutine containing the new work.
-
submitSuspendable
final Unit submitSuspendable(SuspendFunction0<Unit> work)
Cancels the previous work and launches a new coroutine containing the new suspendable work.
-
cancelLastDebounce
final Unit cancelLastDebounce()
Cancels the current work without shutting down the Coroutine scope.
-
-
-
-