Skip to main content

XpmActions.get() method

Retrieves an action by name, creating it if not yet instantiated.

Signature

get(actionName: string): XpmAction;

Parameters

Parameter

Type

Description

actionName

string

The name of the action to retrieve.

Returns

XpmAction

The action instance.

Exceptions

XpmError If an action with that name does not exist.

Remarks

This method implements lazy evaluation to avoid unnecessary operations. Actions are instantiated on demand but remain uninitialised until actually used. The two-step process works as follows:

  1. During collection initialisation (XpmActions.initialise()), only the matrix of options is evaluated for each template, expanding only the action names without processing their content.
  2. Later, when an action is accessed via this method and subsequently initialised (XpmAction.initialise()), the template is fully evaluated and Liquid substitutions are performed on the commands.

This approach ensures that only actions that are actually used incur the cost of template evaluation and variable substitution.


Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.