Creates a computed Alien Signal based on a getter function. Computed signals are read-only and update automatically when their dependencies change.
The type of the computed value.
A getter function returning the computed value.
A computed signal.
const count = createSignal(1);const double = createComputed(() => count() * 2); Copy
const count = createSignal(1);const double = createComputed(() => count() * 2);
Creates a computed Alien Signal based on a getter function. Computed signals are read-only and update automatically when their dependencies change.