Skip to content

Computed Signals

Computed signals derive values from other signals. They automatically recalculate when dependencies change.

const firstName = signal('John');
const lastName = signal('Doe');
const fullName = computed(() => `${firstName()} ${lastName()}`);
console.log(fullName()); // 'John Doe'
firstName.set('Jane');
console.log(fullName()); // 'Jane Doe' (auto-updated!)

Computed signals provide automatic derived state with lazy evaluation.”