throttle method

void throttle()

Implementation

void throttle() async {
  String key = hashCode.toString();
  bool enable = _funcThrottle[key] ?? true;
  if (enable) {
    _funcThrottle[key] = false;
    try {
      await target?.call();
    } catch (e) {
      rethrow;
    } finally {
      _funcThrottle.remove(key);
    }
  }
}