Writable type
Home > @rimitive/signals > Writable
Writable type
Section titled “Writable type”A writable reactive value (signal).
Call with no arguments to read, call with a value to write. Writing notifies all subscribers.
Signature:
export type Writable<T> = Readable<T> & { (value: T): void;};References: Readable
Example
Section titled “Example”const name: Writable<string> = signal('Alice');
// Readconsole.log(name()); // 'Alice'
// Writename('Bob');console.log(name()); // 'Bob'