LogoRobo.js
Framework

executeWithMiddleware()

Function: executeWithMiddleware()

function executeWithMiddleware<Op>(
   operation, 
   model, 
   args, 
execute): Promise<OperationResult<Op>>

Execute operation through middleware pipeline.

Middleware executes in config order (outermost first/last):

  1. Plugin A before
  2. Plugin B before
  3. Actual operation
  4. Plugin B after
  5. Plugin A after

Type Parameters

Type Parameter
Op extends OperationType

Parameters

ParameterTypeDescription
operationOpOperation type (create, update, delete, etc.)
modelFlashcoreModel<{ id: string; }>The model being operated on
argsOperationArgs<Op>Operation arguments (can be mutated by middleware)
execute() => Promise<OperationResult<Op>>The actual operation function

Returns

Promise<OperationResult<Op>>

Operation result (possibly modified by middleware)

On this page