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

Function producerNotifyConsumers

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

Source from the content-addressed store, hash-verified

342 * Propagate a dirty notification to live consumers of this producer.
343 */
344export function producerNotifyConsumers(node: ReactiveNode): void {
345 if (node.consumers === undefined) {
346 return;
347 }
348
349 // Prevent signal reads when we're updating the graph
350 const prev = inNotificationPhase[0];
351 inNotificationPhase[0] = true;
352 try {
353 for (
354 let link: ReactiveLink | undefined = node.consumers;
355 link !== undefined;
356 link = link.nextConsumer
357 ) {
358 const consumer = link.consumer;
359 if (!consumer.dirty) {
360 consumerMarkDirty(consumer);
361 }
362 }
363 } finally {
364 inNotificationPhase[0] = prev;
365 }
366}
367
368/**
369 * 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