Skip to main content
Version: 1.0.0

Typed reactive values

This reference documents every current public declaration in this part of Pine. Examples run inside App.Mount(), a component factory, or an explicit P.Root(...) unless they only create state/configuration. Explicit P.Mount(...) remains available for advanced ownership. Variable names such as count, items and label refer to the typed values described by each example. All APIs run on Unity’s main thread.

Value​

Value<T>

A typed literal-or-getter adapter for mutable UI inputs.

public Value(T literal)

Constructs this value with the supplied typed arguments.

public Value(Func<T> read)

Constructs this value with the supplied typed arguments.

Value.IsDynamic​

bool IsDynamic

Reports whether this adapter wraps a getter.

Value.Read​

public T Read()

Returns the literal or invokes its getter with normal dependency tracking.

Value.implicit​

public static implicit operator Value<T>(T value)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

public static implicit operator Value<T>(Func<T> getter)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

public static implicit operator Value<T>(Source<T> source)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

public static implicit operator Value<T>(ReadOnly<T> source)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

public static implicit operator Value<T>(Derived<T> source)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

public static implicit operator Value<T>(Spring<T> source)

Converts a typed literal, getter or supported reactive value into a literal-or-getter adapter.

ReadOnly​

ReadOnly<T>

A framework-owned reactive value that callers can observe without replacing it.

ReadOnly.Value​

T Value

Reads the framework-owned value with dependency tracking.

ReadOnly.Peek​

public T Peek()

Reads the framework-owned snapshot without collecting a dependency.

Source​

Source<T>

Mutable typed reactive state.

Source.Value​

T Value

Reads with dependency tracking and writes with notifications under the source equality policy.

Source.Peek​

public T Peek()

Returns a source snapshot without collecting a dependency.

Source.Set​

public T Set(T value)

Assigns the typed source value and returns the value supplied.

Source.Notify​

public void Notify()

Explicitly notifies observers after mutating a referenced value in place.

Derived​

Derived<T>

An owned cached pure calculation with dynamically tracked dependencies.

Derived.Value​

T Value

Returns the current cached pure result and tracks downstream reads.

Derived.Dispose​

public void Dispose()

Ends this owned lifetime idempotently.