( full: string, chunkSize = 8, )
| 3 | |
| 4 | /** Yield progressively longer prefixes of HTML (simulates token stream) */ |
| 5 | export function* streamChunks( |
| 6 | full: string, |
| 7 | chunkSize = 8, |
| 8 | ): Generator<string, void, unknown> { |
| 9 | for (let i = chunkSize; i < full.length + chunkSize; i += chunkSize) { |
| 10 | yield full.slice(0, Math.min(i, full.length)); |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | /** Run rehtml at each chunk boundary */ |
| 15 | export function streamSnapshots( |
no outgoing calls