Beignet API reference
    Preparing search index...

    Interface CreateUseCaseOptions<Ctx>

    Options for createUseCase(...).

    interface CreateUseCaseOptions<Ctx> {
        instrumentation?: boolean;
        onRun?: (event: UseCaseRunEvent<Ctx>) => void | Promise<void>;
        validate?: boolean | { input?: boolean; output?: boolean };
    }

    Type Parameters

    • Ctx
    Index
    instrumentation?: boolean

    Built-in use-case instrumentation.

    By default every run records usecase lifecycle events (plus error events for failed runs) into the provider instrumentation port resolved from ctx.ports (ports.instrumentation, then ports.devtools). When no port is installed, runs stay silent. Pass false to opt out.

    true
    
    onRun?: (event: UseCaseRunEvent<Ctx>) => void | Promise<void>

    Optional app-owned observer called on use case start, end, and error.

    Observers run in addition to the built-in instrumentation.

    validate?: boolean | { input?: boolean; output?: boolean }

    Enable or disable schema validation for use case boundaries.

    Defaults to validating both input and output. Pass false to opt out, or configure phases independently with { input: boolean, output: boolean }.