Vixen
02b45cc4
csharp
public static class ReactiveGraph

The ambient state the signal graph is threaded through: who is currently reading, how many writes have happened, and which thread is allowed to touch any of it.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Nothing here is a container of signals. The graph is the nodes and the edges between them; this type holds only what has to be global, which is the currently-evaluating consumer (so that reading a signal can record the edge without anyone passing a context around) and a write counter used as a cheap "nothing has changed since" check.

Per ADR-007 the model is Angular's: writing pushes invalidation, reading pulls evaluation. A write marks dependents dirty and evaluates nothing; a read of a Computed`1 re-runs it only if a dependency's version actually moved.

Fields and properties (2)

  • public static Thread? OwningThread

    The thread allowed to read and write signals, or for no check.

  • public static bool InBatch

    Whether a Batch is currently open on this thread.

Methods (3)

  • public static T Untracked<T>(Func<T> read)

    Reads without subscribing: edges recorded inside are not.

  • public static void Untracked(Action action)

    Runs without recording any dependency it reads.

  • public static void Batch(Action action)

    Runs as one unit of change: any effect flush asked for inside it happens once, after it returns.

Used by (9)

  • CollectionSignalVixen.Ui.Reactive
  • ComputedVixen.Ui.Reactive
  • EffectVixen.Ui.Reactive
  • EffectSchedulerVixen.Ui.Reactive
  • EffectTestsVixen.Ui.Reactive.Tests
  • LinkedSignalVixen.Ui.Reactive
  • ReactiveNodeVixen.Ui.Reactive
  • SignalVixen.Ui.Reactive
  • SignalTestsVixen.Ui.Reactive.Tests