8
8
*/
9
9
10
10
import type { UpdateQueue as HookQueue } from './ReactFiberHooks.new' ;
11
- import type { SharedQueue as ClassQueue } from './ReactUpdateQueue .new' ;
11
+ import type { SharedQueue as ClassQueue } from './ReactFiberClassUpdateQueue .new' ;
12
12
13
13
// An array of all update queues that received updates during the current
14
14
// render. When this render exits, either because it finishes or because it is
15
15
// interrupted, the interleaved updates will be transferred onto the main part
16
16
// of the queue.
17
- let interleavedQueues : Array <
17
+ let concurrentQueues : Array <
18
18
HookQueue < any , any > | ClassQueue < any > ,
19
19
> | null = null ;
20
20
21
- export function pushInterleavedQueue (
21
+ export function pushConcurrentUpdateQueue (
22
22
queue : HookQueue < any , any > | ClassQueue < any > ,
23
23
) {
24
- if ( interleavedQueues === null ) {
25
- interleavedQueues = [ queue ] ;
24
+ if ( concurrentQueues === null ) {
25
+ concurrentQueues = [ queue ] ;
26
26
} else {
27
- interleavedQueues . push ( queue ) ;
27
+ concurrentQueues . push ( queue ) ;
28
28
}
29
29
}
30
30
31
- export function enqueueInterleavedUpdates ( ) {
31
+ export function finishQueueingConcurrentUpdates ( ) {
32
32
// Transfer the interleaved updates onto the main queue. Each queue has a
33
33
// `pending` field and an `interleaved` field. When they are not null, they
34
34
// point to the last node in a circular linked list. We need to append the
35
35
// interleaved list to the end of the pending list by joining them into a
36
36
// single, circular list.
37
- if ( interleavedQueues !== null ) {
38
- for ( let i = 0 ; i < interleavedQueues . length ; i ++ ) {
39
- const queue = interleavedQueues [ i ] ;
37
+ if ( concurrentQueues !== null ) {
38
+ for ( let i = 0 ; i < concurrentQueues . length ; i ++ ) {
39
+ const queue = concurrentQueues [ i ] ;
40
40
const lastInterleavedUpdate = queue . interleaved ;
41
41
if ( lastInterleavedUpdate !== null ) {
42
42
queue . interleaved = null ;
@@ -50,6 +50,6 @@ export function enqueueInterleavedUpdates() {
50
50
queue . pending = ( lastInterleavedUpdate : any ) ;
51
51
}
52
52
}
53
- interleavedQueues = null ;
53
+ concurrentQueues = null ;
54
54
}
55
55
}
0 commit comments