SHARE
TWEET

Untitled

a guest Jun 18th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   searchBooksByDetails(sc: any): Observable<Array<Book>> {
  2.     this.books$ = this.getBooks();
  3.     this.books$ = this.books$.pipe(
  4.       debounceTime(2000),
  5.       map(books =>
  6.         books.filter(
  7.           book =>
  8.             book.title.toLowerCase().includes(sc.title.toLowerCase()) &&
  9.             book.author.toLocaleLowerCase().includes(sc.author.toLocaleLowerCase()) &&
  10.             book.publisher.toLowerCase().includes(sc.publisher.toLowerCase()) &&
  11.             (sc.category === 'ALL' || book.category === sc.category) &&
  12.             (!sc.publishedFrom || book.publicationDate > sc.publishedFrom) &&
  13.             (!sc.publishedTo || book.publicationDate < sc.publishedTo)
  14.         )
  15.       )
  16.     );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top