@tempots/dom

Prop class

Represents a property signal that holds a value of type T. It extends the Signal class.

Signature:

declare class Prop extends Signal 

Extends: Signal

Properties

Property

Modifiers

Type

Description

atProp

readonly

(key: K) => Prop

Returns a Prop that represents the value at the specified key of the current value.

is

static

(value: T_1 | Prop | Signal | Computed) => value is Prop

Checks if a value is a Prop.

iso

readonly

(to: (value: T) => O, from: (value: O) => T, equals?: (a: O, b: O) => boolean) => Prop

Creates an isomorphism for the Signal. An isomorphism is a pair of functions that convert values between two types, along with an equality function to compare values of the second type.

reducer

readonly

(fn: (acc: T, value: A) => T, ...effects: ReducerEffect[]) => (action: A) => void

Creates a reducer function that combines the provided reducer function and effects.

set

readonly

(value: T) => void

Changes the value of the property and notifies its listeners.

update

readonly

(fn: (value: T) => T) => void

Updates the value of the signal by applying the provided function to the current value.

value

T

Access for the current value of the property.