Type Alias NextFn<TParameters, TReturn>

NextFn: InvokableFn<[args?: TParameters], TReturn>

Represents the next middleware function in the chain.

When invoked, continues execution to the next middleware or the final function. Allows middleware to decide whether to proceed with execution and with what arguments.

Type Parameters

  • TParameters extends unknown[] = unknown[]

    Type of arguments passed through the middleware chain

  • TReturn = unknown

    Type of value returned from the function

// In middleware
next() // Continue with original args
next([newArg1, newArg2]) // Continue with modified args

IMPORT_PATH: @daiso-tech/core/middleware