Perf tweak
This commit is contained in:
parent
ffbfbe4519
commit
1cff694df2
1 changed files with 4 additions and 2 deletions
|
@ -127,7 +127,9 @@ function queueIfNeeded() {
|
||||||
let i = 0
|
let i = 0
|
||||||
while (queue.length > 0) {
|
while (queue.length > 0) {
|
||||||
i++
|
i++
|
||||||
if (i > 5) {
|
if (i === 4) {
|
||||||
|
// react might be skipping updates, perhaps in concurrent mode.
|
||||||
|
//we can recheck the queue later
|
||||||
setTimeout(queueIfNeeded, 1)
|
setTimeout(queueIfNeeded, 1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -135,7 +137,7 @@ function queueIfNeeded() {
|
||||||
for (const item of queue) {
|
for (const item of queue) {
|
||||||
item.runUpdate()
|
item.runUpdate()
|
||||||
}
|
}
|
||||||
})
|
}, 1)
|
||||||
}
|
}
|
||||||
microtaskIsQueued = false
|
microtaskIsQueued = false
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue