Skip to content

@serenity-is/domwise / computed

Variable: computed()

const computed: <T>(fn, options?) => Computed<T>

Defined in: src/signals.ts:56

Creates a computed (derived) signal that re-computes when its dependencies change. Re-exported from @preact/signals-core.

Type Parameters

T

T

The type of the computed value.

Parameters

fn

() => T

A computation function that returns the derived value.

options?

SignalOptions<T>

Optional signal options.

Returns

Computed<T>

A read-only Computed<T> signal.