Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.termDebouncer.pipe(
- map(val => (val + '').trim()),
- filter(val => val.length > 0),
- distinctUntilChanged(),
- debounceTime(500),
- tap(console.log),
- switchMap(term => this.mockService.checkValue(term)),
- map(respose => { invalid: true } : null)
- ).subscribe(validity => this.validationEmitter.next(validity))
- this.termDebouncer.next(control.value)
- return this.validationEmitter.asObservable()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement