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

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

View File

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