Skip to main content

HostActionInterceptor

type

Middleware around one action. Call `next(action.input)` to let it run untouched. Call `next` with a different input to rewrite what runs. Return a result without calling `next` and the action never reaches its owner, which is how a hook blocks or substitutes. Throwing rejects the caller.

type HostActionInterceptor<K extends HostActionId> = (action: HostActionEnvelope<K>, ctx: HostActionContext, next: HostActionNext<K>) => Promise<CanonicalHostActionResult<K>>

Import

import { HostActionInterceptor } from '@modular/sdk';

Notes

category
Context