MCPcopy
hub / github.com/angular/angular / run

Function run

packages/core/primitives/signals/src/watch.ts:98–126  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 const run = () => {
99 if (node.fn === null) {
100 // trying to run a destroyed watch is noop
101 return;
102 }
103
104 if (isInNotificationPhase()) {
105 throw new Error(
106 typeof ngDevMode !== 'undefined' && ngDevMode
107 ? 'Schedulers cannot synchronously execute watches while scheduling.'
108 : '',
109 );
110 }
111
112 node.dirty = false;
113 if (node.version > 0 && !consumerPollProducersForChange(node)) {
114 return;
115 }
116 node.version++;
117
118 const prevConsumer = consumerBeforeComputation(node);
119 try {
120 node.cleanupFn();
121 node.cleanupFn = NOOP_CLEANUP_FN;
122 node.fn(registerOnCleanup);
123 } finally {
124 consumerAfterComputation(node, prevConsumer);
125 }
126 };
127
128 node.ref = {
129 notify: () => consumerMarkDirty(node),

Callers

nothing calls this directly

Calls 5

isInNotificationPhaseFunction · 0.90
consumerAfterComputationFunction · 0.90
fnMethod · 0.45

Tested by

no test coverage detected