зеркало из https://github.com/mozilla/reflex.git
Fix error in preemptive-animation-frame scheduler
This commit is contained in:
Родитель
0c1db5ed03
Коммит
adbe0b66ff
|
@ -27,6 +27,7 @@ export const requestAnimationFrame = /*::<a>*/
|
||||||
const id = ++nextID
|
const id = ++nextID
|
||||||
requests.push(request)
|
requests.push(request)
|
||||||
ids.push(id)
|
ids.push(id)
|
||||||
|
state = PENDING_REQUEST
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ const performAnimationFrame =
|
||||||
// too late, so we just do it preemptively.
|
// too late, so we just do it preemptively.
|
||||||
window.requestAnimationFrame(performAnimationFrame)
|
window.requestAnimationFrame(performAnimationFrame)
|
||||||
state = EXTRA_REQUEST
|
state = EXTRA_REQUEST
|
||||||
|
ids.splice(0)
|
||||||
dispatchAnimationFrame(requests.splice(0), 0, time)
|
dispatchAnimationFrame(requests.splice(0), 0, time)
|
||||||
break
|
break
|
||||||
case EXTRA_REQUEST:
|
case EXTRA_REQUEST:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче