-
Notifications
You must be signed in to change notification settings - Fork 2
ObservableCollection
API / ObservableCollection<TItem> class
Represents an observable collection.
Extends: ReadOnlyObservableCollection<TItem>, implements IObservableCollection<TItem>.
class ObservableCollection<TItem> extends ReadOnlyObservableCollection<TItem> implements IObservableCollection<TItem>
- TItem: the type of items the collection contains.
- constructor: initializes a new instance of the ObservableCollection<TItem> class.
- push: appends new elements to the end of the collection, and returns the new length of the collection.
-
pop: removes the last element from the collection and returns it. If the collection is empty,
undefined
is returned. - unshift: inserts new elements at the start of the collection, and returns the new length of the collection.
-
shift: removes the first element from the collection and returns it. If the collection is empty,
undefined
is returned. - get: gets the item at the provided index.
- set: sets the provided item at the provided index.
- splice: removes and/or adds elements to the collection and returns the deleted elements.
-
clear: Clears the contents of the collection and returns the removed items, similar to calling
collection.splice(0)
. -
reset: resets the contents of the collection by clearing it and setting the provided items. Returns the new length of the collection. Similar to calling
collection.splice(0, collection.length, ...items)
.
Motivation
Overview
Guides and Tutorials - Getting Started
Releases
API
Events
IEvent
IEventHandler
INotifyPropertiesChanged
INotifyCollectionChanged
IItemAddedEventArgs
IItemRemovedEventArgs
ICollectionChange
ItemRemovedCallback
ICollectionChange
EventDispatcher
Observable Collections
IReadOnlyObservableCollection
IObservableCollection
ReadOnlyObservableCollection
ObservableCollection
ViewModels
ViewModel
isViewModel
Forms
IFormFieldViewModel
IFormFieldViewModelConfig
FormFieldViewModel
FormFieldCollectionViewModel
FormFieldSet
DynamicFormFieldCollectionViewModel
Validation
IReadOnlyValidatable
IValidatable
IValidationConfig
ValidatorCallback
CollectionItemValidatorCallback
ValidatableSelectorCallback
ValidationConfigSelectorCallback
UnsubscribeCallback
registerValidators
registerCollectionValidators
registerCollectionItemValidators
React Hooks
EventHandler
useEvent
ViewModelType
ViewModelFactory
useViewModel
useViewModelMemo
useObservableCollection
useValidators
useCollectionValidators
useCollectionItemValidators