Type Alias MiddlewareArgs<TParameters, TReturn>

MiddlewareArgs: {
    args: TParameters;
    name: string;
    next: NextFn<TParameters, TReturn>;
}

Arguments passed to middleware functions during execution.

Contains the original function arguments, a reference to the next middleware in the chain.

Type Parameters

  • TParameters extends unknown[] = unknown[]

    Type of arguments passed to the function

  • TReturn = unknown

    Type of value returned from the function

Type declaration

  • args: TParameters

    The arguments passed to the original function

  • name: string

    The name of the function.

  • next: NextFn<TParameters, TReturn>

    Function to call the next middleware or final function

const loggingMiddleware: MiddlewareFn = ({ args, next }) => {
console.log('Before:', args);
const result = next(args);
console.log('After:', result);
return result;
};

IMPORT_PATH: @daiso-tech/core/middleware