MCPcopy Create free account
hub / github.com/microsoft/SandDance / scheduleInteractions

Function scheduleInteractions

docs/external/js/react-dom.development.js:23457–23487  ·  view source on GitHub ↗
(root, expirationTime, interactions)

Source from the content-addressed store, hash-verified

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

Callers 2

commitRootImplFunction · 0.85

Calls 6

computeThreadIDFunction · 0.85
getMethod · 0.45
forEachMethod · 0.45
hasMethod · 0.45
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected