@@ -224,14 +224,7 @@ function processCompleted(
224
224
incremental . push ( incrementalResult ) ;
225
225
}
226
226
227
- context . pendingResultsById . delete ( completedResult . id ) ;
228
- const path = pendingResult . path . join ( '.' ) ;
229
- const labels = context . pendingLabelsByPath . get ( path ) ;
230
- invariant ( labels != null ) ;
231
- labels . delete ( label ) ;
232
- if ( labels . size === 0 ) {
233
- context . pendingLabelsByPath . delete ( path ) ;
234
- }
227
+ deletePendingResult ( context , pendingResult , label ) ;
235
228
continue ;
236
229
}
237
230
@@ -283,18 +276,26 @@ function processCompleted(
283
276
284
277
incremental . push ( incrementalResult ) ;
285
278
286
- context . pendingResultsById . delete ( completedResult . id ) ;
287
- const path = pendingResult . path . join ( '.' ) ;
288
- const labels = context . pendingLabelsByPath . get ( path ) ;
289
- invariant ( labels != null ) ;
290
- labels . delete ( label ) ;
291
- if ( labels . size === 0 ) {
292
- context . pendingLabelsByPath . delete ( path ) ;
293
- }
279
+ deletePendingResult ( context , pendingResult , label ) ;
294
280
}
295
281
return incremental ;
296
282
}
297
283
284
+ function deletePendingResult (
285
+ context : TransformationContext ,
286
+ pendingResult : PendingResult ,
287
+ label : string ,
288
+ ) : void {
289
+ context . pendingResultsById . delete ( pendingResult . id ) ;
290
+ const path = pendingResult . path . join ( '.' ) ;
291
+ const labels = context . pendingLabelsByPath . get ( path ) ;
292
+ invariant ( labels != null ) ;
293
+ labels . delete ( label ) ;
294
+ if ( labels . size === 0 ) {
295
+ context . pendingLabelsByPath . delete ( path ) ;
296
+ }
297
+ }
298
+
298
299
function transformInitialResult <
299
300
T extends ExecutionResult | InitialIncrementalExecutionResult ,
300
301
> ( context : TransformationContext , result : T ) : T {
0 commit comments