Iterate over the contents of the array.
Discard all values in the array, leaving an empty array.
Test whether a value is an array with identical contents to this array.
Find the index at which the given value first occurs in the array,
optionally starting at fromIndex. If the value doesn't occur in the
array, return -1.
OptionalfromIndex: numberInsert the given values starting at the given index, shifting the remainder of the array to higher indices accordingly.
Test whether the array is empty.
Append the provided values to the end of the array.
the number of values that were inserted.
Return a read-only view of the array.
Write the given value to the given index of the array, overwriting anything that may have been there before.
Get the size of the array.
Prepend the provided values to the start of the array.
the number of values that were inserted.
StaticfromStaticis
An array which behaves like a signal.
Any read operation on the array, like Signal.Array.get, Signal.Array.size, or iteration, acts like a Signal.State.get, registering the array as a dependency in any computed signals or effects it's used in. Correspondingly, any write operation to the array will cause all of these dependencies to update as with a Signal.State.set.
Note that the API of this array is different from the built-in Array. This is intentional. Additionally, many operations you'd expect to find on an array, like Array.map or predicates like Array.every, are missing from the array itself. It's recommended that you access these through Iterators instead.
Note also that array access doesn't come with any granularity: if you read only a single index from the array inside a computed signal, any change to the array causes the signal to recompute, regardless of whether the value at the index you read changed.