MCPcopy Create free account
hub / github.com/angular/angular / producerNotifyConsumers

Function producerNotifyConsumers

packages/core/primitives/signals/src/graph.ts:339–361  ·  view source on GitHub ↗
(node: ReactiveNode)

Source from the content-addressed store, hash-verified

337 * Propagate a dirty notification to live consumers of this producer.
338 */
339export function producerNotifyConsumers(node: ReactiveNode): void {
340 if (node.consumers === undefined) {
341 return;
342 }
343
344 // Prevent signal reads when we're updating the graph
345 const prev = inNotificationPhase;
346 inNotificationPhase = true;
347 try {
348 for (
349 let link: ReactiveLink | undefined = node.consumers;
350 link !== undefined;
351 link = link.nextConsumer
352 ) {
353 const consumer = link.consumer;
354 if (!consumer.dirty) {
355 consumerMarkDirty(consumer);
356 }
357 }
358 } finally {
359 inNotificationPhase = prev;
360 }
361}
362
363/**
364 * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,

Callers 2

signalValueChangedFunction · 0.90
consumerMarkDirtyFunction · 0.85

Calls 1

consumerMarkDirtyFunction · 0.85

Tested by

no test coverage detected