Vixen
02b45cc4
csharp
public sealed class LinkedSignal<TSource, T>

A writable value that goes back to being derived whenever its source changes.

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

Remarks

The shape of nearly every selection in an editor. The inspector shows the selected object's first tab; the user clicks the third; the selection changes and the tab has to go back to the first. Written as a Signal`1, that last step is an effect that watches the selection and writes the tab, and it is one of the most reliable sources of bugs in a UI — the write happens at the wrong time, or twice, or races the panel being rebuilt.

Written as a linked signal it is a declaration: the tab is the first tab of the selection, unless somebody has since said otherwise. Angular's linkedSignal, which ADR-007 names.

Fields and properties (1)

  • public T Value

    The current value: derived, or whatever was last written since the source last moved.

Methods (2)

  • public LinkedSignal(Func<TSource> source, Func<TSource, T, T> compute, IEqualityComparer<TSource>? sourceComparer = null, IEqualityComparer<T>? comparer = null)

    Creates a linked signal.

  • public T Peek()

    The current value without recording a dependency.

Used by (1)

  • LinkedSignalTestsVixen.Ui.Reactive.Tests