ArrayDataSource
此内容尚不支持你的语言。
Defined in: ui/collection/data-source.ts:37
DataSource backed by a mutable array, with helper methods that mutate the array and notify subscribers in one call.
Type Parameters
Section titled “Type Parameters”T
Implements
Section titled “Implements”DataSource<T>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ArrayDataSource<
T>(items?):ArrayDataSource<T>
Defined in: ui/collection/data-source.ts:41
Parameters
Section titled “Parameters”items?
Section titled “items?”readonly T[] = []
Returns
Section titled “Returns”ArrayDataSource<T>
Methods
Section titled “Methods”append()
Section titled “append()”append(
items):void
Defined in: ui/collection/data-source.ts:72
Append items to the end. Emits insert.
Parameters
Section titled “Parameters”readonly T[]
Returns
Section titled “Returns”void
getCount()
Section titled “getCount()”getCount():
number
Defined in: ui/collection/data-source.ts:45
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”getItem()
Section titled “getItem()”getItem(
index):T
Defined in: ui/collection/data-source.ts:49
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”T
Implementation of
Section titled “Implementation of”insert()
Section titled “insert()”insert(
index,items):void
Defined in: ui/collection/data-source.ts:79
Insert items at index. Emits insert.
Parameters
Section titled “Parameters”number
readonly T[]
Returns
Section titled “Returns”void
remove()
Section titled “remove()”remove(
index,count?):void
Defined in: ui/collection/data-source.ts:86
Remove count items starting at index. Emits remove.
Parameters
Section titled “Parameters”number
count?
Section titled “count?”number = 1
Returns
Section titled “Returns”void
setItems()
Section titled “setItems()”setItems(
items):void
Defined in: ui/collection/data-source.ts:65
Replace all items. Emits a reset.
Parameters
Section titled “Parameters”readonly T[]
Returns
Section titled “Returns”void
subscribe()
Section titled “subscribe()”subscribe(
listener):Unsubscribe
Defined in: ui/collection/data-source.ts:57
Subscribe to change notifications; returns an unsubscribe fn.
Parameters
Section titled “Parameters”listener
Section titled “listener”(c) => void
Returns
Section titled “Returns”Unsubscribe
Implementation of
Section titled “Implementation of”update()
Section titled “update()”update(
index,item):void
Defined in: ui/collection/data-source.ts:95
Replace item at index. Emits update.
Parameters
Section titled “Parameters”number
T
Returns
Section titled “Returns”void