I apologize for the delay in responding, but I only encountered this issue today and managed to resolve it quickly.
To address the problem, I followed these steps:
Firstly, I imported the necessary functions as follows:
import {debounceTime} from 'rxjs/operators';
import {pipe} from 'rxjs'
Next, I created a constant using the pipe method (initially attempted without duplicating pipe, but had to resort to this workaround):
const debouncetime = pipe(debounceTime(1000));
Finally, I used it before subscribing to an observable. For example, when implementing an email validator with custom messages:
const emailControl = this.registerForm.get('email');
emailControl.valueChanges
.pipe(debouncetime)
.subscribe(value => this.setEmailMessage(emailControl))
While perhaps not the optimal solution, it proved effective in my case. Hopefully, this explanation can benefit others facing a similar issue!