Skip to content

Commit

Permalink
use symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Oct 4, 2023
1 parent 5bd0347 commit 4409a9c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ import { PrerenderManifest } from '../../..'
import { normalizeAppPath } from '../../../../shared/lib/router/utils/app-paths'
import { SizeLimit } from '../../../../../types'

const NEXT_PRIVATE_GLOBAL_WAIT_UNTIL = Symbol.for(
'__next_private_global_wait_until__'
)

// @ts-ignore
globalThis.__next_private_global_wait_until__ =
globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL] =
// @ts-ignore
globalThis.__next_private_global_wait_until__ || []
globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL] || []

export function getRender({
dev,
Expand Down Expand Up @@ -159,7 +163,7 @@ export function getRender({
if (event && event.waitUntil) {
event.waitUntil(
// @ts-ignore
Promise.all([...globalThis.__next_private_global_wait_until__])
Promise.all([...globalThis[NEXT_PRIVATE_GLOBAL_WAIT_UNTIL]])
)
}

Expand Down

0 comments on commit 4409a9c

Please sign in to comment.