Throttle class
Throttle utility to limit function call frequency
Example:
final throttled = Throttle(Duration(milliseconds: 100));
throttled(() => print('Called at most once per 100ms'));
final newThrottled = throttled.copyWith(delay: Duration(milliseconds: 200));
Properties
Methods
-
call(
void action()) → void - Executes the function immediately if not throttled, otherwise waits
-
cancel(
) → void - Cancels any pending throttle
-
copyWith(
{Duration? delay}) → Throttle - Creates a copy of this Throttle with the given fields replaced
-
dispose(
) → void - Disposes the throttle instance
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited