I am looking to retrieve the most recent subscription from a group of subscriptions.
Whenever the value of my FormControl
changes, I want to capture only the latest value after the user has finished typing. Below is the code snippet I am using -
let control = this.register.controls['email'];
control.valueChanges.debounceTime(300).pipe(take(1)).subscribe(newValue => {
console.log(newValue);
})
However, this code returns multiple Subscriptions
. How can I ensure that I only get the latest one?
Thank you!