throttle abstract method

void throttle(
  1. void callback(), {
  2. Duration duration = const Duration(milliseconds: 500),
})

throttle function to limit the rate at which a callback is called. Throttling is often used to control the frequency of function calls, especially when dealing with user input or events

For example:

ref.throttle(() => myFunction(), duration: Duration(seconds: 6));

input:  1-2-3---4-5-6---7-8-|
result: 1-------4-------7---|

See also:

Implementation

void throttle(
  void Function() callback, {
  Duration duration = const Duration(milliseconds: 500),
});