debounce method

void debounce()

Implementation

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