Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- search = (text$: Observable<string>) =>
- text$.pipe(
- debounceTime(300),
- distinctUntilChanged(),
- tap(() => (this.searching = true)),
- switchMap(term =>
- term.length < 2
- ? []
- : this.ordersSvc.search(term, this.commaList(this.fulfillment_status), this.commaList(this.payment_status)).pipe(
- tap(() => (this.searchFailed = false)),
- catchError(() => {
- this.searchFailed = true;
- return of([]);
- })
- )
- ),
- tap(() => (this.searching = false))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement