Skip to content

Add a way to stop debouncer #7

@floatdrop

Description

@floatdrop

Now there is no way to stop running debouncer. With current API it is not trivial to add Stop/Cancel function, because we returning raw function, that is very handy to call.

I think new Option like WithContext could suffice for canceling, but this leads to replacing AfterFunc for select on Done channel and Timer.C channel.

Another thoughts:

  • if we cancelling debouncer - should be call debounced function or it should not be called?
  • do we even need cancelation (if debounce usually set to small durations)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions