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.
ReadonlymodifyUpdate the element at a specific index by applying a function to it.
Fails with OutOfBoundsError if the index is outside [0, length).
Prefer modifyAt over replaceAt when the new value depends on the
old one — the function receives the current value and returns the
next one without a round-trip through get.
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.
ReadonlyreplaceReplace the element at a specific index with a new value.
Fails with OutOfBoundsError if the index is outside [0, length).
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