Skip to content

@serenity-is/domwise / Signal

Interface: Signal<T>

Defined in: types/basic-types.d.ts:102

A writable signal whose value can be set.

Extends

Type Parameters

T

T

The type of the signal's value.

Accessors

value

Set Signature

set value(value): void

Defined in: types/basic-types.d.ts:103

Current value; reading may track a dependency when inside an effect/computed.

Parameters
value

T

Returns

void

Overrides

SignalLike.value

Methods

peek()

peek(): T

Defined in: types/basic-types.d.ts:89

Returns the current value without creating a dependency.

Returns

T

The current value.

Inherited from

SignalLike.peek


subscribe()

subscribe(fn): EffectDisposer

Defined in: types/basic-types.d.ts:95

Subscribes to value changes.

Parameters

fn

(value) => void

Callback invoked with each new value (and typically immediately with the current value).

Returns

EffectDisposer

A disposer that unsubscribes, or null if unsubscription is not supported.

Inherited from

SignalLike.subscribe