DataSource
此内容尚不支持你的语言。
Defined in: ui/collection/data-source.ts:22
Abstract backing store for a virtualized list. Producers implement
getCount + getItem at minimum; optional methods provide
heterogeneous item types, stable identity for diffing, and change
notifications so consumers can mark themselves dirty.
Type Parameters
Section titled “Type Parameters”T = unknown
Methods
Section titled “Methods”getCount()
Section titled “getCount()”getCount():
number
Defined in: ui/collection/data-source.ts:23
Returns
Section titled “Returns”number
getItem()
Section titled “getItem()”getItem(
index):T
Defined in: ui/collection/data-source.ts:24
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”T
getItemId()?
Section titled “getItemId()?”
optionalgetItemId(index,item):string|number
Defined in: ui/collection/data-source.ts:28
Stable identity to support future reorder-aware diffing.
Parameters
Section titled “Parameters”number
T
Returns
Section titled “Returns”string | number
getItemType()?
Section titled “getItemType()?”
optionalgetItemType(index):string
Defined in: ui/collection/data-source.ts:26
Defaults to 'default'. Used to route items to the matching template.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”string
subscribe()?
Section titled “subscribe()?”
optionalsubscribe(listener):Unsubscribe
Defined in: ui/collection/data-source.ts:30
Subscribe to change notifications; returns an unsubscribe fn.
Parameters
Section titled “Parameters”listener
Section titled “listener”(change) => void
Returns
Section titled “Returns”Unsubscribe