Expand all

ve.dm.TransactionProcessor.modifiers

Constructor

new ve.dm.TransactionProcessor.modifiers() #

Modifier methods.

Each method executes a specific type of linear model modification, updates the model tree, and returns a function that undoes the linear model modification, in case we need to recover the previous linear model state. (The returned undo function does not undo the model tree update.) Methods are called in the context of a transaction processor, so they work similar to normal methods on the object.

Source:
Modifier methods.

Methods

setAttribute(offset, key, value)static #

Set an attribute at a given offset.

Parameters:

Name Type Description
offset number

Offset in data array (unadjusted)

key string

Attribute name

value any

New attribute value

Source:
Set an attribute at a given offset.

splice(splices)static #

Splice data into / out of the data array, and synchronize the tree.

For efficiency, this function modifies the splice operation objects (i.e. the elements of the splices array). It also relies on these objects not being modified by others later.

Parameters:

Name Type Description
splices Array.<Object>

Array of splice operations to execute. Properties: {number} splices[].offset Offset to remove/insert at (unadjusted) {number} splices[].removeLength Number of elements to remove {Array} splices[].insert Data to insert; for efficiency, objects are inserted without cloning

Source:
Splice data into / out of the data array, and synchronize the tree.