cake_wallet/lib/utils/debounce.dart
2022-01-26 17:44:15 +02:00

14 lines
No EOL
256 B
Dart

import 'dart:async';
import 'package:flutter/foundation.dart';
class Debounce {
Debounce(this.duration);
final Duration duration;
Timer _timer;
void run(VoidCallback action) {
_timer?.cancel();
_timer = Timer(duration, action);
}
}