Debounce
  • 18 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Debounce

  • Dark
    Light
  • PDF

Implements basic debounce, meaning this node will trigger its output only after Time to wait milliseconds have passed since the last input event received by the node.

For example, if you attached this flow function to the On change event of an input field with 500 ms Time to wait, its output would trigger 500 ms after the user stops typing. Until that, it will act as gate, discarding incoming events and preventing logic from executing too often.

Additional parameters allow more fine-tuned control.

See also the Throttle flow function

Input arguments

Label Key Type Required? Default Description
Time to wait wait Number(integer) Yes 500 Debounce wait time in milliseconds.
Trigger on leading edge? leading Boolean Yes Should the output be triggered immediately when the first event is received?
Trigger on trailing edge? trailing Boolean Yes true Should the output be trigger after Time to wait has passed since the last event received?
Maximum time to wait maxWait Number(integer) No Maximum time to wait before triggering the output, regardless of event frequency.

Output arguments

Number of outputs: 1

No output arguments.

Events

No events.

Errors

No errors.


Was this article helpful?

What's Next