Skip to main content

CollectionSelector

view on npm

A selector for data

.id : string

The internal ID of the Selector

.instanceId : string

The internal id of the Selector with an instance prefix

.key : DataKey | null

The key of a data item assigned to this selector

.value : DataType

Return the data value of the selected item

.data : PlexusDataInstance | null

The data of the selector

.canRedo : boolean

Can the state be redone any further?

.canUndo : boolean

Can the state be undone any further?

.select(key) ⇒ this

Select an item in the collection

Returns: this

The selector instance

ParamTypeDescription
keystring | number

The key to select

.set(value) ⇒ this

Set the value of the selected data instance

Returns: this

The selector instance

ParamTypeDescription
valueDataType

The value to set

.patch(value) ⇒ this

Patch the value of the selected data instance

Returns: this

The selector instance

ParamTypeDescription
valueDataType

The value to set

.history(maxLength) ⇒ this

Enable, disable, or set the history length of the state history stored for this selector

Returns: this

The selector instance

ParamTypeDefaultDescription
maxLengthnumber10

The maximum length of the history

.undo() ⇒ this

Undo the last change to the state

Returns: this

The selector instance

.redo() ⇒ this

Redo the last change to the state

Returns: this

The selector instance

.clear()

Clears the selector