Vixen
dd8b0a81
csharp
public sealed class Signal<T>

A writable value that everything reading it is re-evaluated against.

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

Remarks

Writing a value equal to the current one does nothing at all — no version bump, no notification, no effect run. That is not an optimisation bolted on the side; it is the property the rest of the graph is built to preserve, and the reason a text box that re-assigns the same string on every keystroke does not repaint the window.

"Equal" means Default unless a comparer is supplied. For a mutable reference type that is usually wrong — the object is the same instance, so it compares equal, and a change made in place is invisible. Either hold an immutable value, or pass Never``1 and accept that every write propagates.

Fields and properties (1)

  • public T Value

    The current value.

Methods (5)

  • public Signal(T initial, IEqualityComparer<T>? comparer = null)

    Creates a signal holding .

  • public T Peek()

    The current value without recording a dependency.

  • public void Update(Func<T, T> update)

    Replaces the value with a function of the current one.

  • public void Update<TState>(TState state, Func<T, TState, T> update)

    Replaces the value with a function of the current one and some state.

  • public void Invalidate()

    Forces every dependent to re-evaluate, whatever the comparer thinks.

Used by (151, showing 40)

  • ActionBarMmo.Ui
  • ActionSlotMmo.Ui
  • BagGridMmo.Ui
  • BagModelMmo.Ui
  • BagSlotMmo.Ui
  • ChatModelMmo.Ui
  • ChatPanelMmo.Ui
  • GalleryHelloUi
  • HudMmo.Ui
  • HudModelMmo.Ui
  • HudTestsMmo.Ui.Tests
  • LootRollMmo.Ui
  • LootRollModelMmo.Ui
  • ObjectiveEntryMmo.Ui
  • QuestEntryMmo.Ui
  • QuestTrackerMmo.Ui
  • ShellHelloUi
  • ShellModelHelloUi
  • SnapshotHelloUi
  • UnitFrameMmo.Ui
  • UnitModelMmo.Ui
  • VendorModelMmo.Ui
  • VendorPanelMmo.Ui
  • VendorRowMmo.Ui
  • AsyncArrivalTestsVixen.Ui.Controls.Tests
  • AsyncComputedVixen.Ui.Reactive
  • AsyncComputedTestsVixen.Ui.Reactive.Tests
  • AsyncHostVixen.Ui.Controls.Tests
  • BackgroundTaskVixen.Ui
  • BareVixen.Ui.Tests
  • BoundVixen.Ui.Tests
  • BoundOverlaySheetVixen.Ui.Controls.Tests
  • BranchingVixen.Ui.Tests
  • BranchingRefsVixen.Ui.Tests
  • BrokenBindingTestsVixen.Ui.Tests
  • BuildContextVixen.Ui
  • CarryingVixen.Ui.HotReload.Tests
  • CompositionTestsVixen.Ui.Tests
  • ComputedTestsVixen.Ui.Reactive.Tests
  • ConvertedVixen.Ui.Controls.Tests