зеркало из 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
|
||||
requests.push(request)
|
||||
ids.push(id)
|
||||
state = PENDING_REQUEST
|
||||
return id
|
||||
}
|
||||
|
||||
|
@ -58,6 +59,7 @@ const performAnimationFrame =
|
|||
// too late, so we just do it preemptively.
|
||||
window.requestAnimationFrame(performAnimationFrame)
|
||||
state = EXTRA_REQUEST
|
||||
ids.splice(0)
|
||||
dispatchAnimationFrame(requests.splice(0), 0, time)
|
||||
break
|
||||
case EXTRA_REQUEST:
|
||||
|
|
Загрузка…
Ссылка в новой задаче