This repository was archived by the owner on Jul 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,17 @@ export async function render(
91
91
92
92
// `renderToString` might be invoked repeatedly when asyncchronous callbacks exist.
93
93
while ( true ) {
94
+ if ( asyncCalls . length > 0 ) {
95
+ const calls = asyncCalls . splice ( 0 , asyncCalls . length )
96
+ const datas = await Promise . all ( calls . map ( a => a [ 2 ] ) )
97
+ calls . forEach ( ( [ id , expires ] , i ) => {
98
+ const value = datas [ i ]
99
+ renderingData [ id ] = value
100
+ data [ id ] = { value, expires }
101
+ } )
102
+ }
94
103
try {
95
- if ( asyncCalls . length > 0 ) {
96
- const calls = asyncCalls . splice ( 0 , asyncCalls . length )
97
- const datas = await Promise . all ( calls . map ( a => a [ 2 ] ) )
98
- calls . forEach ( ( [ id , expires ] , i ) => {
99
- const value = datas [ i ]
100
- renderingData [ id ] = value
101
- data [ id ] = { value, expires }
102
- } )
103
- }
104
- Object . keys ( rendererStore ) . forEach ( key => rendererStore [ key as keyof typeof rendererStore ] . clear ( ) )
104
+ Object . values ( rendererStore ) . forEach ( map => map . clear ( ) )
105
105
ret . body = renderToString ( createElement (
106
106
SSRContext . Provider ,
107
107
{ value : rendererStore } ,
You can’t perform that action at this time.
0 commit comments