control

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interval

func Interval(ctx context.Context, interval time.Duration, f func())

Interval calls `f` at regular `interval` until the `ctx` is cancelled.

func NewDebouncer

func NewDebouncer(after time.Duration) func(f func())

NewDebouncer returns a debounced function that delays execution until after `after` duration has passed since the last call.

func NewThrottle

func NewThrottle(interval time.Duration) func(f func()) bool

NewThrottle returns a throttled function that ensures `f` is not executed more frequently than `interval`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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