Private
#lengthPrivate
#storeReturns true if the reactive list has been destroyed, and false otherwise. This property is useful for determining whether it is safe to interact with the reactive list. A destroyed reactive list will not respond to any methods or properties except for this one.
Retrieves the length of the reactive list.
The length of the reactive list.
Adds the given values to the reactive list as ReactiveProps items. Updates the internal store and the length atom accordingly.
Rest
...values: T[]The values to add to the list.
Sets the value of the ReactiveProps item at the specified index. If the item exists at the given index, its value is updated.
The index of the item to update in the reactive list.
The new value to set for the item at the specified index.
Sets multiple items in the reactive list, updating existing items or adding new ones as necessary. If the new number of items is less than the current length of the list, the excess items are destroyed. Operates within a batch to optimize performance and prevent unnecessary reactivity triggers.
The new values to set in the reactive list.
Removes a specified number of items from the reactive list, starting at a given index. The function operates within a batch to optimize performance and prevent unnecessary reactivity triggers.
The index at which to start removing items from the list.
The number of items to remove from the list.
Subscribes a function to be called whenever the value of this reactive list changes. The function is called with a Map of updates, where the keys are the names of the items that changed, and the values are UpdateDataRecord objects.
The function to be called whenever the value of this reactive list changes.
A function that unsubscribes the given function.
ReactiveList is a class that represents a reactive list of items. It allows adding, removing, and updating items in the list while maintaining reactivity.
Example