don't use rIC while scrolling (#455)

* don't use rIC while scrolling

* remove unnecessary import
This commit is contained in:
Nolan Lawson 2018-08-20 17:57:38 -07:00 committed by GitHub
parent c4c70dfd89
commit 6ad20e72a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 8 deletions

View File

@ -4,8 +4,6 @@
import throttle from 'lodash-es/throttle' import throttle from 'lodash-es/throttle'
import { isFullscreen, attachFullscreenListener, detachFullscreenListener } from '../../_utils/fullscreen' import { isFullscreen, attachFullscreenListener, detachFullscreenListener } from '../../_utils/fullscreen'
import { mark, stop } from '../../_utils/marks' import { mark, stop } from '../../_utils/marks'
import { scheduleIdleTask } from '../../_utils/scheduleIdleTask'
import { isMobile } from '../../_utils/isMobile'
import { doubleRAF } from '../../_utils/doubleRAF' import { doubleRAF } from '../../_utils/doubleRAF'
import { observe } from 'svelte-extras' import { observe } from 'svelte-extras'
@ -95,12 +93,7 @@
onScroll (event) { onScroll (event) {
let { scrollTop, scrollHeight } = event.target let { scrollTop, scrollHeight } = event.target
// On mobile devices, this can make scrolling more responsive. On doubleRAF(() => {
// desktop browsers... it's probably overkill, and can lead to a
// checkerboarding issue ("I just scrolled, why is it blank for 5 seconds?").
let runTask = isMobile() ? scheduleIdleTask : requestAnimationFrame
runTask(() => {
mark('onScroll -> setForRealm()') mark('onScroll -> setForRealm()')
this.store.setForRealm({scrollTop, scrollHeight}) this.store.setForRealm({scrollTop, scrollHeight})
stop('onScroll -> setForRealm()') stop('onScroll -> setForRealm()')