2020-03-16 19:38:35 +00:00
|
|
|
import { PushFn } from '../renderToString'
|
2020-03-10 20:52:08 +00:00
|
|
|
|
2020-03-16 19:38:35 +00:00
|
|
|
export async function ssrRenderSuspense(
|
|
|
|
push: PushFn,
|
|
|
|
{ default: renderContent }: Record<string, (() => void) | undefined>
|
|
|
|
) {
|
|
|
|
if (renderContent) {
|
|
|
|
push(`<!--[-->`)
|
|
|
|
renderContent()
|
|
|
|
push(`<!--]-->`)
|
|
|
|
} else {
|
|
|
|
push(`<!---->`)
|
2020-03-10 20:52:08 +00:00
|
|
|
}
|
|
|
|
}
|