Skip to main content

Function: applyAction()

function applyAction<TRet>(subtreeRoot, call): TRet;

Applies (runs) an action over a target object.

It runs any kind of action (built-in, standalone, model actions and flows), but not views. To apply calls that come from outside (e.g. as JSON), decode them with a serializer (defaultSerializer.decodeCall) and use applyCall / applyCallAsync instead, which check what may be called.

Type Parameters​

Type ParameterDefault type
TRetany

Parameters​

ParameterTypeDescription
subtreeRootobjectSubtree root target object to run the action over.
callActionCallThe action, usually as coming from onActionMiddleware.

Returns​

TRet

The return value of the action, if any.