Skip to main content

Function: applyCall()

function applyCall<TRet>(
root,
call,
options?
): TRet;

Runs a call (as returned by Serializer.decodeCall, or built in process) on a tree and returns its result as is. Flows are refused (call.isFlow); use applyCallAsync for them.

The call's name is resolved on its target (see CallKind), then canCall decides whether it may run (by default only model actions may). Errors about the call are CallErrors; errors thrown by the action or view are rethrown as they are.

Type Parameters​

Type ParameterDefault typeDescription
TRetunknownReturn type.

Parameters​

ParameterTypeDescription
rootobjectRoot of the tree.
call| Call | ResolvedCallThe call.
options?ApplyCallOptionsOptions.

Returns​

TRet

The result of the call.