DebouncedSignal<T> constructor
- Signal<
T> source, - Duration duration, {
- String? debugLabel,
- bool equals(
- T a,
- T b
- T guard(
- T current,
- T next
- VoidCallback? onListen,
- VoidCallback? onCancel,
Implementation
DebouncedSignal(
this.source,
this.duration, {
String? debugLabel,
super.equals,
super.guard,
super.onListen,
super.onCancel,
}) : super(source.val, debugLabel: debugLabel) {
_subscription = source.stream.listen((value) {
_debounceTimer?.cancel();
_debounceTimer = Timer(duration, () {
emit(value);
});
});
}