nodeHelpers

Methods

(static) cloneNode(sourceNode, excludeFieldsopt) → {object}

Create a deep copy of an SGNode with all its fields This is useful for creating queue items from UI nodes without modifying the original

IMPORTANT: This creates a NEW node that is disconnected from any field observers Modifying fields on the returned node will NOT trigger observers on the source node

Example: queueItem = nodeHelpers.cloneNode(uiNode, ["image", "focusable"])

Parameters:
NameTypeAttributesDefaultDescription
sourceNodeobject

The node to copy from

excludeFieldsobject<optional>
[]

Optional array of field names to exclude from copying

Returns:

A new node of the same type with all fields copied

Type: 
object