mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
15 lines
254 B
Dart
15 lines
254 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);
|
|
}
|
|
}
|