Skip to content

Commit

Permalink
perf(runtime-core): optimized code
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoErii committed Jan 2, 2024
1 parent 6408c43 commit b3a97b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/runtime-core/src/components/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function patchSuspense(
} else {
// toggled before pending tree is resolved
// increment pending ID. this is used to invalidate async callbacks
suspense.pendingId = ++suspenseId
suspense.pendingId = suspenseId++
if (isHydrating) {
// if toggled before hydration is finished, the current DOM tree is
// no longer valid. set it as the active branch so it will be unmounted
Expand Down Expand Up @@ -356,7 +356,7 @@ function patchSuspense(
if (newBranch.shapeFlag & ShapeFlags.COMPONENT_KEPT_ALIVE) {
suspense.pendingId = newBranch.component!.suspenseId!
} else {
suspense.pendingId = ++suspenseId
suspense.pendingId = suspenseId++
}
patch(
null,
Expand Down Expand Up @@ -476,7 +476,7 @@ function createSuspenseBoundary(
hiddenContainer,
anchor,
deps: 0,
pendingId: 0,
pendingId: suspenseId++,
timeout: typeof timeout === 'number' ? timeout : -1,
activeBranch: null,
pendingBranch: null,
Expand Down

0 comments on commit b3a97b4

Please sign in to comment.