Merge branch 'master' into docs/restructure-docs

This commit is contained in:
squidfunk
2021-10-10 09:44:26 +02:00
12 changed files with 50 additions and 28 deletions

View File

@@ -107,12 +107,8 @@ export function mountSearch(
tx$
.pipe(
filter(isSearchQueryMessage),
sample(rx$
.pipe(
filter(isSearchReadyMessage),
take(1)
)
)
sample(rx$.pipe(filter(isSearchReadyMessage))),
take(1)
)
.subscribe(tx$.next.bind(tx$))

View File

@@ -33,6 +33,7 @@ import {
finalize,
map,
observeOn,
skipUntil,
switchMap,
take,
tap,
@@ -102,20 +103,18 @@ export function mountSearchResult(
const list = getElementOrThrow(":scope > :last-child", el)
/* Update search result metadata when ready */
rx$
const ready$ = rx$
.pipe(
filter(isSearchReadyMessage),
take(1)
)
.subscribe(() => {
resetSearchResultMeta(meta)
})
/* Update search result metadata */
internal$
.pipe(
observeOn(animationFrameScheduler),
withLatestFrom(query$)
withLatestFrom(query$),
skipUntil(ready$)
)
.subscribe(([{ items }, { value }]) => {
if (value)

View File

@@ -127,10 +127,10 @@ export function setupSearchWorker(
/* Set up search index */
from(index)
.pipe(
map<SearchIndex, SearchSetupMessage>(data => ({
map(data => ({
type: SearchMessageType.SETUP,
data: setupSearchIndex(data)
}))
} as SearchSetupMessage))
)
.subscribe(tx$.next.bind(tx$))