1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-23 23:21:00 +01:00

Improved semantics when returning from switchMap

This commit is contained in:
squidfunk 2022-03-08 10:31:38 +01:00
parent eea6d1eec4
commit 1d1cf476c8
11 changed files with 18 additions and 20 deletions

View File

@ -214,7 +214,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.130b2e88.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.897f3768.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -16,5 +16,5 @@
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.2e51be42.min.js' | url }}"></script>
<script src="{{ 'overrides/assets/javascripts/bundle.a375bc7d.min.js' | url }}"></script>
{% endblock %}

View File

@ -260,7 +260,7 @@ export function setupInstantLoading(
.pipe(
skip(1),
map(() => getComponentElement("container")),
switchMap(el => of(...getElements("script", el))),
switchMap(el => getElements("script", el)),
concatMap(el => {
const script = h("script")
if (el.src) {

View File

@ -25,7 +25,6 @@ import {
fromEvent,
mapTo,
mergeMap,
of,
switchMap,
takeWhile,
tap,
@ -63,9 +62,9 @@ export function patchIndeterminate(
): void {
document$
.pipe(
switchMap(() => of(...getElements<HTMLInputElement>(
switchMap(() => getElements<HTMLInputElement>(
"[data-md-state=indeterminate]"
))),
)),
tap(el => {
el.indeterminate = true
el.checked = false

View File

@ -26,7 +26,6 @@ import {
fromEvent,
mapTo,
mergeMap,
of,
switchMap,
tap
} from "rxjs"
@ -77,7 +76,7 @@ export function patchScrollfix(
): void {
document$
.pipe(
switchMap(() => of(...getElements("[data-md-scrollfix]"))),
switchMap(() => getElements("[data-md-scrollfix]")),
tap(el => el.removeAttribute("data-md-scrollfix")),
filter(isAppleDevice),
mergeMap(el => fromEvent(el, "touchstart")

View File

@ -218,7 +218,7 @@ export function mountIconSearchResult(
.pipe(
bufferCount(10),
zipWith(boundary$),
switchMap(([chunk]) => of(...chunk))
switchMap(([chunk]) => chunk)
)
)),
withLatestFrom(query$)

View File

@ -108,7 +108,7 @@ export function resolve(
return from(glob(pattern, options))
.pipe(
catchError(() => EMPTY),
switchMap(files => from(files)),
switchMap(files => files),
options?.watch
? mergeWith(watch(pattern, options))
: identity