VxFunctionExtension extension

on

Methods

debounce([Duration delay = const Duration(seconds: 1)]) → dynamic Function()
Function debounce When an event is triggered, the target operation is not executed immediately. Instead, a delayed time is given. If another event is triggered within that time range, the delay time is reset. The target operation is executed only after the delay time expires. For example, if the delay time is set to 1000ms: If no event is triggered within 1000ms, the target operation is executed. If another event is triggered within 1000ms, the delay time is reset, and the target operation is executed after another 1000ms delay.
throttle([Duration delay = const Duration(seconds: 1)]) → dynamic Function()
Throttle function When an event is triggered, the target operation is executed immediately. At the same time, a delayed time is given. If another event is triggered within that time range, the event is ignored and not processed until an event is triggered after the specified time range. For example, if the delay time is set to 1000ms: If another event is triggered within 1000ms, the event is ignored. If the delay of 1000ms expires, the event is not ignored, and the target operation is executed immediately. Then, another 1000ms delay is started.