Skip to main content

Function: serializeActionCallArgument()

function serializeActionCallArgument(argValue, targetRoot?):
| JSONPrimitiveValue
| SerializedActionCallArgument;

Transforms an action call argument by returning a SerializedActionCallArgument. The following are supported out of the box:

  • Primitives.
  • Nodes that are under the same root node as the target root (when provided) will be serialized as a path.
  • Nodes that are not under the same root node as the target root will be serialized as their snapshot.
  • Arrays (observable or not).
  • Dates.
  • Maps (observable or not).
  • Sets (observable or not).
  • Plain objects (observable or not).

If the value cannot be serialized it will throw an exception.

Parameters​

ParameterTypeDescription
argValueanyArgument value to be transformed into its serializable form.
targetRoot?objectTarget root node of the model where this action is being performed.

Returns​

| JSONPrimitiveValue | SerializedActionCallArgument

The serializable form of the passed value.