Discover Packages
github.com/kode4food/toe
internal
debounce
package
Version:
v0.4.20
Opens a new window with list of versions in this module.
Published: Nov 26, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package debounce coalesces repeated calls, alone or per key, into the last one
type Debouncer struct {
}
Debouncer runs the last function given once calls have gone quiet for the delay
New creates a Debouncer that waits delay after the last call
Do schedules fn, replacing any call still waiting
Stop drops the waiting call and ignores later ones
Keyed runs the last function given for a key once that key has gone quiet for the delay
NewKeyed creates a Keyed that waits delay after the last call per key
func (k *Keyed [K]) Cancel(key K)
Cancel drops the call waiting for key
func (k *Keyed [K]) Do(key K, fn func())
Do schedules fn for key, replacing any call for key still waiting
func (k *Keyed [K]) Stop()
Stop drops every waiting call and ignores later ones
Source Files
¶
Click to show internal directories.
Click to hide internal directories.