I have a stream that uses the startWith
operator and debounceTime
. I want the first value to skip the debounceTime and start immediately. How can I do it?
control.valueChanges
.pipe(
startWith(control.value), <=== this needs to skip debounce
debounceTime(200),
map(...),
);
Just switch the order of operators and use startWith
after debounceTime
.
control.valueChanges.pipe(
debounceTime(200),
startWith(control.value),
map(...),
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With