class · System.Reactive

Computed<T>

public class System.Reactive.Computed<T> : System.Any

A value computed from reactive ones, kept until one of them changes: what computed T P => e; makes.

Kind
class
Namespace
System.Reactive
Assembly
System.Core
Access
public, final
Source file
Reactive.ant

Type parameters

NameConstraints
Tany type

Inheritance

Base classes
Any Computed<T>

Constructors

constructor Computed(compute: func<> : T)
#

Properties

property Value: T
#

read-only

The value (computed now when stale); reading it inside an effect makes the effect depend on it.

property Stale: bool
#

read-only

Whether the next read computes it again.

Methods

method Dispose() -> void
#

Stops tracking: it keeps its last value and no Source invalidates it again.

Private and internal members (5)

field compute: func<> : T
#

private

field value: T
#

private

field source: System.Reactive.Source
#

private

field tracker: System.Reactive.Effect
#

private

method Refresh() -> void
#

private

Inherited members (5)

Source

Computed<T> as Larva HIR, decompiled from its Larva HIR.

System.Reactive.Computed.hir
// A value computed from reactive ones, kept until one of them changes: what `computed T P => e;` makes.
public class System.Reactive.Computed<T> : System.Any
{
    field compute: func<> : T
    field value: T
    field source: System.Reactive.Source
    field tracker: System.Reactive.Effect
    method Refresh() -> void
    constructor Computed(compute: func<> : T)
    // Stops tracking: it keeps its last value and no Source invalidates it again.
    method Dispose() -> void
    // The value (computed now when stale); reading it inside an effect makes the effect depend on it.
    property Value: T
    // Whether the next read computes it again.
    property Stale: bool
}
Esc