Files
hash-wallet/lib/utils/debounce.dart
T
jwinterm 788318a3a2 style: format Dart at 100 columns, as upstream does
Upstream reformatted its whole tree in 16ddc0837. Matching it removes
formatting from the conflict surface of this and every later sync.
2026-10-24 22:48:17 -04:00

20 lines
318 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);
}
void cancel() {
_timer?.cancel();
_timer = null;
}
}