Skip to content

Releases: floatdrop/debounce

v2.0.1

18 Jun 19:02

Choose a tag to compare

Fixed counter reset on WithLimit

Fixed bug: when using WithLimit option - counter was not set to 0 on reaching limit.

v2.0.0

16 Jun 08:13
517e1d7

Choose a tag to compare

Channel based version of debouncer

It provides Chan function to wrap channel with debounce. On top of it there is now implemented Debouncer helper, that will wrap chan func() and execute functions from it. It should be closed with Close method.

See examples.

v1.4.3

15 Jun 05:19
7c9896d

Choose a tag to compare

Double trigger bug

Fixed a bug with double triggering on reaching MaxCalls/MaxWait limits.

v1.4.2

14 Jun 17:44

Choose a tag to compare

Fixed a bug, when subsequent call of debounced will overwrite stored function pointer and previous call, that breaches call limiit will call different function. See ExampleWithMaxCalls in example_test.go.

v1.4.1

14 Jun 12:27
2e42cd4

Choose a tag to compare

Limited call blocks current goroutine

When calls or wait limit is reached, debounced function was called on current goroutine. It is not intended to be so, because every other call will not block and just reschedule timer that calls function in separate goroutine.

v1.4.0

14 Jun 11:33
c95c7ae

Choose a tag to compare

NewFunc helper

For simplicity NewFunc is added to library. Now it is easier to store debounce with predefined function in structure to call it later.

v1.3.2

14 Jun 11:13
a2b7e56

Choose a tag to compare

Zero memory allocations on debounce call

#4 removed allocation of Timer structure on every debounce call. This will help to debounce heavy workloads, that tend to call debounce a lot.

1.3.1

14 Jun 09:55
2363c71

Choose a tag to compare

Fixed startWait initialization that was set to current time in constructor, but should be set to current time on debounce call.

1.3.0

14 Jun 09:18

Choose a tag to compare

WithMaxCalls and WithMaxWait

This release adds two new options (as well as functional Option type for creating more options in future).

See readme for usage examples.