[]previous and next page

markObservers

Marks the direct observers of a changed source DIRTY and everything downstream CHECK, and queues the effects it reaches.

Marks the direct observers of a changed source DIRTY and everything downstream CHECK, and queues the effects it reaches. It does not request a flush: call schedule afterward, or use notify, which does both. Iterative: the graph can be 100,000 nodes deep (G-10).

Import#

ts
import { markObservers } from "@shadow-js/core/extend";

Signature#

ts
function markObservers(source: Source): void

Parameters#

Name Description
source The source whose value changed.

Examples#

ts
import { markObservers, schedule, type SignalNode } from "@shadow-js/core/extend";

export function push(list: SignalNode<string[]>, item: string): void {
  list.value.push(item); // same array: writeSignal would see no change
  markObservers(list);
  schedule();
}