debounce

package
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debouncer

type Debouncer struct {
	// contains filtered or unexported fields
}

Debouncer provides debounced execution of functions. It ensures that functions are executed at most once per delay period, with automatic cleanup after execution.

func New

func New(delay time.Duration) *Debouncer

New creates a new Debouncer with the specified delay.

func (*Debouncer) Do

func (d *Debouncer) Do(fn func())

Do executes the function fn after the delay. If called multiple times within the delay period, only the last fn will execute after the delay.

func (*Debouncer) Queued

func (d *Debouncer) Queued() bool

func (*Debouncer) Stop

func (d *Debouncer) Stop()

Stop shuts down the debouncer goroutine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL