debounce method

void debounce(
  1. T value
)

Implementation

void debounce(T value) {
  String key = hashCode.toString();
  Timer? timer = _funcDebounce[key];
  timer?.cancel();
  timer = Timer(Duration(milliseconds: timeout), () {
    Timer? t = _funcDebounce.remove(key);
    t?.cancel();
    target?.call(value);
  });
  _funcDebounce[key] = timer;
}