APEX Debounce & Throttle Dynamic Actions: A Visual Guide
In APEX Dynamic Actions, there is a Debounce & Throttle setting on the Dynamic Action Event.,
The default is Immediate meaning it fires the actions immediately on capturing the event, but what does Debounced and Throttle mean?
The APEX help describes their meaning and examples:
Immediate
Actions are executed immediately.
Debounce
Actions are only executed once after a specified time at the end of a single or series of events.
Example 1:
Update a text field if the user has stopped typing for 2 seconds and use the values last entered.
Example 2:
Refresh a region once after a click and ignore all other clicks in the next 5 seconds.
Throttle
Actions are executed at timed intervals when the action is fired multiple times.
Example 1:
During scrolling, update the current screen position at least every 2 seconds. The action will continue to fire if the user keeps scrolling.
Example 2:
As a user types, update a text field with the values entered at least every 2 seconds. The action will continue to fire as the user keeps typing.
However I cant help but think that a visual example would help here.
So the above video there are a few things going on
The Lorem Ipsum text is being simulated to type into a field.
It types at 30ms per character and pauses for 3000ms after each sentence.
The 3 boxes above count how many characters have been typed & fire on the keyup event.
Each box glows briefly after each change of character count
The Immediate glows whilst typing
The Debouce glows 1000ms after the final keyup event
The Throttle glows periodically at 1000ms timed intervals during the keyup events
Want to try this out for yourself?
Click here to see the test application
I hows this visual aid helps your understanding of Debounce & Throttle Dynamic Actions
Whats the picture? It's some crooked steps on the Nidderdale Greenway
Subscribe to my newsletter
Read articles from Matt Mulvaney directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Matt Mulvaney
Matt Mulvaney
With around 20 years on the job, Matt is one of the most experienced software developers at Pretius. He likes meeting new people, traveling to conferences, and working on different projects. He’s also a big sports fan (regularly watches Leeds United, Formula 1, and boxing), and not just as a spectator – he often starts his days on a mountain bike, to tune his mind.