mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Refactored search result component
This commit is contained in:
parent
f39c9f9e68
commit
a18d0a58e4
@ -26,7 +26,8 @@ import {
|
|||||||
distinctUntilChanged,
|
distinctUntilChanged,
|
||||||
filter,
|
filter,
|
||||||
map,
|
map,
|
||||||
switchMap,
|
shareReplay,
|
||||||
|
switchMap
|
||||||
} from "rxjs/operators"
|
} from "rxjs/operators"
|
||||||
|
|
||||||
import { SearchResult } from "modules"
|
import { SearchResult } from "modules"
|
||||||
@ -35,6 +36,17 @@ import { Agent, watchElementOffset } from "utilities"
|
|||||||
import { paintSearchResultList } from "../list"
|
import { paintSearchResultList } from "../list"
|
||||||
import { paintSearchResultMeta } from "../meta"
|
import { paintSearchResultMeta } from "../meta"
|
||||||
|
|
||||||
|
// /* ----------------------------------------------------------------------------
|
||||||
|
// * Types
|
||||||
|
// * ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * Search result state
|
||||||
|
// */
|
||||||
|
// export interface SearchResultState {
|
||||||
|
// result: SearchResult[] /* Search results */
|
||||||
|
// }
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
* Helper types
|
* Helper types
|
||||||
* ------------------------------------------------------------------------- */
|
* ------------------------------------------------------------------------- */
|
||||||
@ -73,12 +85,9 @@ export function watchSearchResult(
|
|||||||
filter(identity)
|
filter(identity)
|
||||||
)
|
)
|
||||||
|
|
||||||
// combine into search result observable...
|
|
||||||
|
|
||||||
/* Paint search results */
|
/* Paint search results */
|
||||||
return result$
|
return result$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap(x => { console.log("watchSearchResult", x) }),
|
|
||||||
paintSearchResultMeta(el, { query$ }),
|
paintSearchResultMeta(el, { query$ }),
|
||||||
paintSearchResultList(el, { render$ })
|
paintSearchResultList(el, { render$ })
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user