run1 method
Implementation
Future<NDDebouncedActionRunResult<R>> run1(P arg) {
if (timer?.isActive ?? false) {
timer?.cancel();
_completer?.complete(const NDDebouncedActionRunResult(false));
}
final completer = Completer<NDDebouncedActionRunResult<R>>();
timer = Timer(duration, () {
try {
completer.complete(NDDebouncedActionRunResult(true, action(arg)));
} catch (err, trace) {
completer.completeError(err, trace);
}
});
_completer = completer;
return completer.future;
}