From a18d0a58e46623f815289af07803d212df4cd5b7 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sun, 22 Dec 2019 17:32:51 +0100 Subject: [PATCH] Refactored search result component --- .../components/search/result/_/index.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/assets/javascripts/components/search/result/_/index.ts b/src/assets/javascripts/components/search/result/_/index.ts index 22dd90fe0..3edfcf445 100644 --- a/src/assets/javascripts/components/search/result/_/index.ts +++ b/src/assets/javascripts/components/search/result/_/index.ts @@ -26,7 +26,8 @@ import { distinctUntilChanged, filter, map, - switchMap, + shareReplay, + switchMap } from "rxjs/operators" import { SearchResult } from "modules" @@ -35,6 +36,17 @@ import { Agent, watchElementOffset } from "utilities" import { paintSearchResultList } from "../list" import { paintSearchResultMeta } from "../meta" +// /* ---------------------------------------------------------------------------- +// * Types +// * ------------------------------------------------------------------------- */ + +// /** +// * Search result state +// */ +// export interface SearchResultState { +// result: SearchResult[] /* Search results */ +// } + /* ---------------------------------------------------------------------------- * Helper types * ------------------------------------------------------------------------- */ @@ -73,12 +85,9 @@ export function watchSearchResult( filter(identity) ) - // combine into search result observable... - /* Paint search results */ return result$ .pipe( - tap(x => { console.log("watchSearchResult", x) }), paintSearchResultMeta(el, { query$ }), paintSearchResultList(el, { render$ }) )