@tempots/dom

Computed class

Represents a computed signal that derives its value from a function. It extends the Signal class.

Signature:

declare class Computed extends Signal 

Extends: Signal

Constructors

Constructor

Modifiers

Description

(constructor)(_fn, equals)

Represents a Signal object.

Properties

Property

Modifiers

Type

Description

get

readonly

() => T

Gets the current value of the signal.

setDirty

readonly

() => void

Marks the signal as dirty, indicating that its value has changed and needs to be recalculated. If the signal is already dirty or disposed, this method does nothing. It also marks all dependent signals as dirty and schedules a notification to update their values.

value

readonly

T

Gets the value of the signal.

Methods

Method

Modifiers

Description

is(value)

static

Checks if a value is an instance of Computed.