wip: only buffer suspense effects when unresolved

This commit is contained in:
Evan You 2019-09-11 09:04:03 -04:00
parent 9ef987830d
commit 6bc368b2b6

View File

@ -82,12 +82,14 @@ function queuePostEffect(
fn: Function | Function[], fn: Function | Function[],
suspense: SuspenseBoundary<any, any> | null suspense: SuspenseBoundary<any, any> | null
) { ) {
if (suspense === null) { if (suspense !== null && !suspense.isResolved) {
queuePostFlushCb(fn) if (isArray(fn)) {
} else if (isArray(fn)) { suspense.effects.push(...fn)
suspense.effects.push(...fn) } else {
suspense.effects.push(fn)
}
} else { } else {
suspense.effects.push(fn) queuePostFlushCb(fn)
} }
} }