| 23455 | } |
| 23456 | |
| 23457 | function scheduleInteractions(root, expirationTime, interactions) { |
| 23458 | |
| 23459 | if (interactions.size > 0) { |
| 23460 | var pendingInteractionMap = root.pendingInteractionMap; |
| 23461 | var pendingInteractions = pendingInteractionMap.get(expirationTime); |
| 23462 | |
| 23463 | if (pendingInteractions != null) { |
| 23464 | interactions.forEach(function (interaction) { |
| 23465 | if (!pendingInteractions.has(interaction)) { |
| 23466 | // Update the pending async work count for previously unscheduled interaction. |
| 23467 | interaction.__count++; |
| 23468 | } |
| 23469 | |
| 23470 | pendingInteractions.add(interaction); |
| 23471 | }); |
| 23472 | } else { |
| 23473 | pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions. |
| 23474 | |
| 23475 | interactions.forEach(function (interaction) { |
| 23476 | interaction.__count++; |
| 23477 | }); |
| 23478 | } |
| 23479 | |
| 23480 | var subscriber = __subscriberRef.current; |
| 23481 | |
| 23482 | if (subscriber !== null) { |
| 23483 | var threadID = computeThreadID(root, expirationTime); |
| 23484 | subscriber.onWorkScheduled(interactions, threadID); |
| 23485 | } |
| 23486 | } |
| 23487 | } |
| 23488 | |
| 23489 | function schedulePendingInteractions(root, expirationTime) { |
| 23490 | |