throttle method

void throttle(
  1. T value
)

Implementation

void throttle(T value) {
  final key = _generateKey();
  if (_funcThrottle[key] ?? true) {
    _funcThrottle[key] = false;
    Timer(Duration(milliseconds: timeout), () => _funcThrottle.remove(key));
    target?.call(value);
  }
}