Removed unnecessary deferrals to animation frames

This commit is contained in:
squidfunk
2021-12-04 11:53:07 +01:00
parent 87df85def8
commit 732565b3af
9 changed files with 15 additions and 26 deletions

View File

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

View File

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

View File

@@ -23,13 +23,11 @@
import { import {
Observable, Observable,
Subject, Subject,
animationFrameScheduler,
bufferCount, bufferCount,
filter, filter,
finalize, finalize,
map, map,
merge, merge,
observeOn,
of, of,
skipUntil, skipUntil,
switchMap, switchMap,
@@ -106,7 +104,6 @@ export function mountSearchResult(
/* Update search result metadata */ /* Update search result metadata */
push$ push$
.pipe( .pipe(
observeOn(animationFrameScheduler),
withLatestFrom(query$), withLatestFrom(query$),
skipUntil(ready$) skipUntil(ready$)
) )
@@ -139,7 +136,6 @@ export function mountSearchResult(
/* Update search result list */ /* Update search result list */
push$ push$
.pipe( .pipe(
observeOn(animationFrameScheduler),
tap(() => list.innerHTML = ""), tap(() => list.innerHTML = ""),
switchMap(({ items }) => merge( switchMap(({ items }) => merge(
of(...items.slice(0, 10)), of(...items.slice(0, 10)),

View File

@@ -22,11 +22,9 @@
import { import {
Observable, Observable,
animationFrameScheduler,
combineLatest, combineLatest,
delay, delay,
map, map,
observeOn,
of, of,
switchMap, switchMap,
withLatestFrom withLatestFrom
@@ -71,8 +69,7 @@ export function patchScrolllock(
map(([active, tablet]) => active && !tablet), map(([active, tablet]) => active && !tablet),
switchMap(active => of(active) switchMap(active => of(active)
.pipe( .pipe(
delay(active ? 400 : 100), delay(active ? 400 : 100)
observeOn(animationFrameScheduler)
) )
), ),
withLatestFrom(viewport$) withLatestFrom(viewport$)

View File

@@ -24,7 +24,6 @@ import { filter as search } from "fuzzaldrin-plus"
import { import {
Observable, Observable,
Subject, Subject,
animationFrameScheduler,
bufferCount, bufferCount,
combineLatest, combineLatest,
distinctUntilKeyChanged, distinctUntilKeyChanged,
@@ -32,7 +31,6 @@ import {
finalize, finalize,
map, map,
merge, merge,
observeOn,
of, of,
switchMap, switchMap,
tap, tap,
@@ -152,7 +150,6 @@ export function mountIconSearchResult(
const meta = getElement(":scope > :first-child", el) const meta = getElement(":scope > :first-child", el)
push$ push$
.pipe( .pipe(
observeOn(animationFrameScheduler),
withLatestFrom(query$) withLatestFrom(query$)
) )
.subscribe(([{ data }, { value }]) => { .subscribe(([{ data }, { value }]) => {
@@ -185,7 +182,6 @@ export function mountIconSearchResult(
const list = getElement(":scope > :last-child", el) const list = getElement(":scope > :last-child", el)
push$ push$
.pipe( .pipe(
observeOn(animationFrameScheduler),
tap(() => list.innerHTML = ""), tap(() => list.innerHTML = ""),
switchMap(({ data }) => merge( switchMap(({ data }) => merge(
of(...data.slice(0, 10)), of(...data.slice(0, 10)),