mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Adds a new export from next/cache that acts as a metasyntactic IO boundary. During prerendering with cache components it returns a hanging promise to prevent execution of code that follows it. In all other contexts it resolves as a fulfilled thenable that React can unwrap synchronously. This is gated behind experimental.unstableIO and not ready for general use.
8 lines
200 B
TypeScript
8 lines
200 B
TypeScript
const { PHASE_PRODUCTION_BUILD } = require('next/constants')
|
|
|
|
export function getSentinelValue() {
|
|
return process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD
|
|
? 'at buildtime'
|
|
: 'at runtime'
|
|
}
|