Skip to main content

Computed<Value, Diff>

A computed signal created via computed.

Type parameters

  • Value
  • Diff = unknown

Hierarchy

Index

Properties

Methods

Properties

isActivelyListening

Readonly boolean

Whether this computed child is involved in an actively-running effect graph.

Defined in: signia/src/Computed.ts:113

lastChangedEpoch

number

The epoch when this signal's value last changed. Note tha this is not the same as when the value was last computed. A signal may recopmute it's value without changing it.

Inherited from: Signal.lastChangedEpoch

Defined in: signia/src/types.ts:36

name

string

The name of the signal. This is used at runtime for debugging and perf profiling only. It does not need to be globally unique.

Inherited from: Signal.name

Defined in: signia/src/types.ts:25

value

Readonly Value

The current value of the signal. This is a reactive value, and will update when the signal changes. Any computed signal that depends on this signal will be lazily recomputed if this signal changes. Any effect that depends on this signal will be rescheduled if this signal changes.

Inherited from: Signal.value

Defined in: signia/src/types.ts:31

Methods

__unsafe__getWithoutCapture()

Returns the current value of the signal without capturing it as a dependency. Use this if you need to retrieve the signal's value in a hot loop where the performance overhead of dependency tracking is too high.

Signature

__unsafe__getWithoutCapture(): Value;

Returns

Value

Inherited from: Signal.unsafegetWithoutCapture

Defined in: signia/src/types.ts:47

getDiffSince()

Returns the sequence of diffs between the the value at the given epoch and the current value. Returns the RESET_VALUE constant if there is not enough information to compute the diff sequence.

Signature

getDiffSince(epoch: number): typeof RESET_VALUE | Diff[];

Parameters

NameType
epochnumber

Returns

typeof RESET_VALUE | Diff[]

Inherited from: Signal.getDiffSince

Defined in: signia/src/types.ts:42