Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- searchBooksByDetails(sc: any): Observable<Array<Book>> {
- this.books$ = this.getBooks();
- this.books$ = this.books$.pipe(
- debounceTime(2000),
- map(books =>
- books.filter(
- book =>
- book.title.toLowerCase().includes(sc.title.toLowerCase()) &&
- book.author.toLocaleLowerCase().includes(sc.author.toLocaleLowerCase()) &&
- book.publisher.toLowerCase().includes(sc.publisher.toLowerCase()) &&
- (sc.category === 'ALL' || book.category === sc.category) &&
- (!sc.publishedFrom || book.publicationDate > sc.publishedFrom) &&
- (!sc.publishedTo || book.publicationDate < sc.publishedTo)
- )
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement