From 806c7850cf1e88930d804e5deb3f358ffae1335f Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 16 Nov 2018 22:23:49 +0900 Subject: [PATCH] Async check in scroll handler for improved scroll performance --- scripts/InfiniteScroller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/InfiniteScroller.ts b/scripts/InfiniteScroller.ts index 35330878..b251be64 100644 --- a/scripts/InfiniteScroller.ts +++ b/scripts/InfiniteScroller.ts @@ -21,8 +21,9 @@ export default class InfiniteScroller { return } - // Otherwise, check immediately. - check() + // Otherwise, queue up the check immediately. + // Don't call check() directly to make scrolling as smooth as possible. + Diff.mutations.queue(check) }) }