@@ -112,9 +112,9 @@ type Request = {
112
112
partialBoundaries : Array < SuspenseBoundary > , // Partially completed boundaries that can flush its segments early.
113
113
// onError is called when an error happens anywhere in the tree. It might recover.
114
114
onError : ( error : mixed ) => void ,
115
- // onComplete is called when all pending work is done but it may not have flushed yet.
115
+ // onCompleteAll is called when all pending work is done but it may not have flushed yet.
116
116
// This is a good time to start writing if you want only HTML and no intermediate steps.
117
- onComplete : ( ) => void ,
117
+ onCompleteAll : ( ) => void ,
118
118
// onReadyToStream is called when there is at least a root fallback ready to show.
119
119
// Typically you don't need this callback because it's best practice to always have a
120
120
// root fallback ready so there's no need to wait.
@@ -144,7 +144,7 @@ export function createRequest(
144
144
responseState : ResponseState ,
145
145
progressiveChunkSize : number = DEFAULT_PROGRESSIVE_CHUNK_SIZE ,
146
146
onError : ( error : mixed ) = > void = noop ,
147
- onComplete : ( ) = > void = noop ,
147
+ onCompleteAll : ( ) = > void = noop ,
148
148
onReadyToStream : ( ) = > void = noop ,
149
149
) : Request {
150
150
const pingedWork = [ ] ;
@@ -164,7 +164,7 @@ export function createRequest(
164
164
completedBoundaries : [ ] ,
165
165
partialBoundaries : [ ] ,
166
166
onError,
167
- onComplete ,
167
+ onCompleteAll ,
168
168
onReadyToStream,
169
169
} ;
170
170
// This segment represents the root fallback.
@@ -429,7 +429,7 @@ function erroredWork(
429
429
430
430
request . allPendingWork -- ;
431
431
if ( request . allPendingWork === 0 ) {
432
- request . onComplete ( ) ;
432
+ request . onCompleteAll ( ) ;
433
433
}
434
434
}
435
435
@@ -476,7 +476,7 @@ function abortWork(suspendedWork: SuspendedWork): void {
476
476
}
477
477
478
478
if ( request . allPendingWork === 0 ) {
479
- request . onComplete ( ) ;
479
+ request . onCompleteAll ( ) ;
480
480
}
481
481
}
482
482
}
@@ -537,7 +537,7 @@ function finishedWork(
537
537
if ( request . allPendingWork === 0 ) {
538
538
// This needs to be called at the very end so that we can synchronously write the result
539
539
// in the callback if needed.
540
- request . onComplete ( ) ;
540
+ request . onCompleteAll ( ) ;
541
541
}
542
542
}
543
543
0 commit comments