debounce
debounce copied to clipboard
callback not be invoked if interval is shorter than `after` param
Example:
d := New(1 * time.Second)
for i := 0; i < 10; i++ {
d(func () {
println("called")
})
time.Sleep(900 * time.Millisecond)
}
Expected:
"called" should be printed 8~9 times.