Throttle function

I think, there is a bug in the throttle function, where it just doesnt repeat in the chosen time. It only works once.

Hi @Dimos_Vamvourellis, could you report this as a bug in the tracker with steps on how to reproduce it?

Hi, i just made this simple test, in my understanding, it should send a toast every 1 sec, but instead it only sends the toast once.
image

and heres the link

Hi, looks like you need a “Delay” node for that instead. If you take a look at what Throttle does, it’s a function that can for example prevent a user from tapping on a button multiple times:

Implements throttle, meaning this node will trigger its output immediately upon receiving an event, and then at most every “Throttle interval” milliseconds. Any extra events received inbetween will be discarded.

This kind of logic sends “1 second” toast every second. Included the “If condition” node, because Toast doesn’t have an output to hook back to the Delay node:

yeah, eventually i did that, But as for the throttle,

I thought this was what debouche did(based on a previous thread i had read)?
to tell you the truth, i was using debouche for this all this time
image

Here’s what debounce does:

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.

Here’s a visual representation of the difference:

http://demo.nimius.net/debounce_throttle/

2 Likes

Alright then, now it definitely makes more cense. Thanks Mari!

1 Like