Classes
ObservableArray
ObservableArray
Advanced array like class used when you want to be notified when a change occurs.
Summary
Constructors
Accessors
Constructors
constructor
new ObservableArray<T>(arrayLength?: number): ObservableArray<T>
new ObservableArray<T>(items: T[]): ObservableArray<T>
new ObservableArray<T>(...items: T[]): ObservableArray<T>
Properties
changeEvent
Static
String value used when hooking to change event.
Accessors
length
Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
Returns number
Methods
[iterator]
Returns Generator<T, void, unknown>
_notifyLengthChange
Returns void
concat
concat(...args: any[]): ObservableArray<T>
every
every(callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any): boolean
Determines whether all the members of an array satisfy the specified test.
Returns boolean
filter
filter(callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any): ObservableArray<T>
Returns the elements of an array that meet the condition specified in a callback function.
Returns ObservableArray<T>
find
find(callbackfn: (value: T, index: number, array: ObservableArray<T>) => any, thisArg?: any): T
Returns the first element in the array where predicate is true, and null otherwise.
Returns T
findIndex
findIndex(callbackfn: (value: T, index: number, array: ObservableArray<T>) => any, thisArg?: any): number
Returns the index of the first element in the array where predicate is true, and -1 otherwise.
Returns number
forEach
forEach(callbackfn: (value: T, index: number, array: ObservableArray<T>) => void, thisArg?: any): void
Performs the specified action for each element in an array.
Returns void
getItem
Returns item at specified position.
Supports relative indexing from the end of the array when passed a negative index.
Returns T
includes
Determines whether the specified element exists inside the array.
Returns boolean
indexOf
Returns the index of the first occurrence of a value in an array.
Returns number
join
Adds all the elements of an array separated by the specified separator string.
Returns string
lastIndexOf
Returns the index of the last occurrence of a specified value in an array.
Returns number
map
map<U>(callbackfn: (value: T, index: number, array: ObservableArray<T>) => U, thisArg?: any): ObservableArray<U>
Calls a defined callback function on each element of an array, and returns an array that contains the results.
Returns ObservableArray<U>
pop
Removes the last element from an array and returns it.
Returns T
push
Appends new elements to an array, and returns the new length of the array.
Returns number
reduce
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ObservableArray<T>) => T, initialValue?: T): T
Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Returns T
reduceRight
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ObservableArray<T>) => T, initialValue?: T): T
Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
Returns T
reverse
reverse(): ObservableArray<T>
Reverses the elements in an Array.
This method uses 'in place' algorithm.
Returns ObservableArray<T>
setItem
Sets item at specified position.
Supports relative indexing from the end of the array when passed a negative index.
Returns void
shift
Removes the first element from an array and returns it.
Returns T
slice
slice(start?: number, end?: number): ObservableArray<T>
some
some(callbackfn: (value: T, index: number, array: ObservableArray<T>) => boolean, thisArg?: any): boolean
Determines whether the specified callback function returns true for any element of an array.
Returns boolean
sort
sort(compareFn?: (a: T, b: T) => number): ObservableArray<T>
splice
splice(start: number, deleteCount?: number, ...items: T[]): ObservableArray<T>
Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
This method uses 'in place' algorithm.
Returns ObservableArray<T>
toJSON
Returns any[]
toLocaleString
Returns string
toString
Returns a string representation of an array.
Returns string
unshift
Inserts new elements at the start of an array.
Returns number
- Previous
- Observable
- Next
- Page