A special throttle implementation that tries to distribute execution
in an optimal way.
Functionality: For UI usage the function is executed on first occasion (leading).
If more calls follow it will again be executed at end (trailing).
If the next call is inside the timeframe, it is delayed until trailing.
This avoids timewise too close calls.
It is possible to cancel the timeout and to flush a call, e.g. if
leaving UI situation where a final call is required to write data or similar.
A special throttle implementation that tries to distribute execution in an optimal way.
Functionality: For UI usage the function is executed on first occasion (
leading). If more calls follow it will again be executed at end (trailing). If the next call is inside the timeframe, it is delayed untiltrailing. This avoids timewise too close calls. It is possible tocancelthe timeout and toflusha call, e.g. if leaving UI situation where a final call is required to write data or similar.