OperationBuilder

Description

This module dispatches these events:

- insert:         (elem)
- remove:         (elem)
- fieldAssign:    (elem, field, val)
- fieldInsert:    (elem, field, val)
- fieldInsertAt:  (elem, field, val, pos)
- fieldRemove:    (elem, field, val)
- fieldRemoveAt:  (elem, field, val, pos)
- fieldReorder:   (elem, field, val, newPos)
- fieldRelocate:  (elem, field, oldParent, newParent)

Variables Summary

Functions Summary

Variables

Public API

OP_INSERT

Functions

Public API

begin

Begin to make an operation.

opName string
Operation name
Public API

discard

Discard currently making operation.

Public API

end

Finish to make an operation.

Public API

fieldAssign

Assign value to field.

elem Element
field string
val nullable
Public API

fieldInsert

Insert an element to array field.

elem Element
field string
val nullable
Public API

fieldInsertAt

Insert a value to array field at a specific position (index).

elem Element
field string
val nullable
pos number
Public API

fieldRelocate

Relocate an element to another parent.

elem Element
Element to be relocated
field string
Field name of parent
oldParent number
Current parent
newParent number
New parent to be located in
Public API

fieldRemove

Remove a value from array field.

elem Element
field string
val nullable
Public API

fieldRemoveAt

Remove a value from array field at a specific position.

elem Element
field string
value nullable
pos number
Public API

fieldReorder

Change order of a value in array field.

elem Element
field string
val nullable
pos number
Position to be placed
Public API

getOperation

Return currently made operation.

Returns: Object

getTimestamp

Return timestamp

Public API

insert

Insert an element.

elem Element
Public API

remove

Remove an element.

elem Element