Skip to content

Writable Signals

Writable signals hold mutable state. They provide getter and setter APIs for reading and updating values.

const count = signal(0);
console.log(count()); // Read: 0
count.set(5); // Set new value
count.update(c => c + 1); // Update based on current
// With objects
const user = signal({ name: 'Alice', age: 30 });
user.set({ name: 'Bob', age: 31 }); // New reference

Writable signals are the foundation of Angular’s reactive state model.”