A Readable that emits the Array itself whenever it changes.
Readonly FunctiononSubscribe to events when a value is needed to be disposed.
A value is considered for disposal when:
The function to call when a value is needed to be disposed.
A disposer function to unsubscribe from the event.
Readonlylength
Gets the length of the array. This is a number one higher than the highest index in the array.
Use .setLength(length) to change the length of the array.
Returns the this object after copying a section of the array identified by start and end to the same array starting at position target
If target is negative, it is treated as length+target where length is the length of the array.
If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.
Optionalend:
number
If not specified, length of the this object is used as its default value.
Changes all array elements from start to end index to a static
value and returns the modified array
value to fill array section with
Optionalstart:
number
index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.
Optionalend:
number
index to stop filling the array at. If end is negative, it is treated as length+end.
Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
Appends new elements to the end of an array, and returns the new length of the array.
New elements to add to the array.
Replaces the contents of the array with the provided items.
The new items to replace the contents of the array with.
The array itself.
Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array.
Overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array.
The index of the value to overwrite. If the index is negative, then it replaces from the end of the array.
The value to write into the array.
Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.
Sorts an array in place. This method mutates the array and returns a reference to the same array.
OptionalcompareFn:
(a:
V, b:
V) =>
number
Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
[11,2,22,1].sort((a, b) => a - b)
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements.
OptionaldeleteCount:
number
The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
An array containing the elements that were deleted.
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
The zero-based location in the array from which to start removing elements.
The number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
Elements to insert into the array in place of the deleted elements.
An array containing the elements that were deleted.
Inserts new elements at the start of an array, and returns the new length of the array.
Elements to insert at the start of the array.
OwnedReactiveArray extends the standard Array interface with reactive capabilities.