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 Unitsubmit(Long debounceMs, Function0<Unit> work)Like submit, but debounced by the given period instead of the one this Debouncer was created with. final UnitsubmitSuspendable(SuspendFunction0<Unit> work)Cancels the previous work and launches a new coroutine containing the new suspendable work. final UnitsubmitSuspendable(Long debounceMs, SuspendFunction0<Unit> work)Like submitSuspendable, but debounced by the given period instead of the one this Debouncer was created with. 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.
-
submitSuspendable
final Unit submitSuspendable(Long debounceMs, SuspendFunction0<Unit> work)
Like submitSuspendable, but debounced by the given period instead of the one this Debouncer was created with.
-
cancelLastDebounce
final Unit cancelLastDebounce()
Cancels the current work without shutting down the Coroutine scope.
-
-
-
-