The type of array elements
Readonly[Readonly[ReadonlychangesStream of value changes (does not include current value)
ReadonlyclearRemove all elements from the array.
ReadonlygetGet the current value
ReadonlyinsertInsert an element at a specific index.
ReadonlylengthReactive length of the array.
ReadonlymoveMove an element from one index to another. Useful for drag-and-drop reordering.
ReadonlypopRemove and return the last element, returning Option.none() if empty.
ReadonlypushAdd one or more elements to the end of the array.
ReadonlyremoveRemove the first occurrence of an element (by reference equality). Returns true if the element was found and removed.
ReadonlyremoveRemove the element at a specific index, returning Option.none() if out of bounds.
ReadonlyreverseReverse the array in-place.
ReadonlysetSet the signal to a new value
ReadonlyshiftRemove and return the first element, returning Option.none() if empty.
ReadonlysortSort the array in-place.
ReadonlyspliceInsert, remove, or replace elements at a specific index. Mirrors Array.prototype.splice.
ReadonlyswapSwap two elements at the given indices.
ReadonlyunshiftAdd one or more elements to the beginning of the array.
ReadonlyupdateUpdate the signal value using a function
ReadonlyvaluesStream of all values (current value followed by changes)
A reactive array that extends Signal with array-specific mutation methods. Mutations happen in-place without cloning, then trigger reactive updates.
Example