Skip to content

M-J-Hooper/debounce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Debounce

A small Go library for debouncing noisy channels.

Example

noisy := make(chan interface{})
go func() {
  for {
    noisy <- interface{}(rand.Intn(2)) // Random signals every millisecond
    time.Sleep(time.Millisecond)
  }
}()

debounced := debounce.Channel(noisy, 10*time.Millisecond)
for stable := range debounced {
  // Signal only if the value has not changed for 10 milliseconds
}

About

A small Go library for debouncing noisy channels.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages