FlowState(states)
Tracks state within a flow. There should be no need to instantiate this class yourself. Initialized state is provided to various Node event listeners.
Parameters
name | type | required | default | description |
---|---|---|---|---|
states | Object | no | {} |
Synopsis
{FlowState} =
new FlowState(
{Object} states
);
flowState.get(node)
Gets a state for a given node.
Parameters
name | type | required | default | description |
---|---|---|---|---|
node | Node | yes |
Returns
The object stored in the state handler for the given node.
Synopsis
{Object} =
flowState.get(
{Node} node
);
flowState.set(node, obj)
Sets a state for a given node. Freezes the object to disallow any future adjustments.
Parameters
name | type | required | default | description |
---|---|---|---|---|
node | Node | yes | ||
obj | Object | yes |
Synopsis
flowState.set(
{Node} node,
{Object} obj
);
flowState.split()
Splits the flowState into a new FlowState.
Returns
The new flowState.
Synopsis
{FlowState} =
flowState.split();