MCPcopy
hub / github.com/stackblitz/alien-signals / signalOper

Function signalOper

src/index.ts:368–395  ·  view source on GitHub ↗
(this: SignalNode<T>, ...value: [T])

Source from the content-addressed store, hash-verified

366}
367
368function signalOper<T>(this: SignalNode<T>, ...value: [T]): T | void {
369 if (value.length) {
370 if (this.pendingValue !== (this.pendingValue = value[0])) {
371 this.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;
372 const subs = this.subs;
373 if (subs !== undefined) {
374 propagate(subs, !!runDepth);
375 if (!batchDepth) {
376 flush();
377 }
378 }
379 }
380 } else {
381 if (this.flags & ReactiveFlags.Dirty) {
382 if (updateSignal(this)) {
383 const subs = this.subs;
384 if (subs !== undefined) {
385 shallowPropagate(subs);
386 }
387 }
388 }
389 const sub = activeSub;
390 if (sub !== undefined) {
391 link(this, sub, cycle);
392 }
393 return this.currentValue;
394 }
395}
396
397function runCleanup(e: EffectNode): void {
398 const cleanup = e.cleanup!;

Callers

nothing calls this directly

Calls 5

propagateFunction · 0.85
flushFunction · 0.85
updateSignalFunction · 0.85
shallowPropagateFunction · 0.85
linkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…