Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. this.termDebouncer.pipe(
  2. map(val => (val + '').trim()),
  3. filter(val => val.length > 0),
  4. distinctUntilChanged(),
  5. debounceTime(500),
  6. tap(console.log),
  7. switchMap(term => this.mockService.checkValue(term)),
  8. map(respose => { invalid: true } : null)
  9. ).subscribe(validity => this.validationEmitter.next(validity))
  10.  
  11. this.termDebouncer.next(control.value)
  12. return this.validationEmitter.asObservable()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement