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):
- Plugin A before
- Plugin B before
- Actual operation
- Plugin B after
- Plugin A after
Type Parameters
| Type Parameter |
|---|
Op extends OperationType |
Parameters
| Parameter | Type | Description |
|---|---|---|
operation | Op | Operation type (create, update, delete, etc.) |
model | FlashcoreModel<{ id: string; }> | The model being operated on |
args | OperationArgs<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)
