Options
All
  • Public
  • Public/Protected
  • All
Menu

DYAL - v1.0.11

Index

Type aliases

CommandBus: UseCaseBus<Command>
Middleware: <T>(context: T, next: Next) => Promise<void>

Type declaration

    • <T>(context: T, next: Next): Promise<void>
    • Middleware takes a context and a next callback to pass the control the next middleware in the stack.

      params

      context This is the use case context it contains dependencies and the use case to handle.

      params

      next It's the callback to call to pass the control to the next middleware in the stack.

      Type parameters

      Parameters

      • context: T
      • next: Next

      Returns Promise<void>

Next: () => Promise<unknown>

Type declaration

    • (): Promise<unknown>
    • Returns Promise<unknown>

QueryBus: UseCaseBus<Query>
UseCaseType: "query" | "command" | "all"

Functions

  • createApp<D>(dependencies: D): DyalApp
  • example
    const dependencies: AppDependencies = { logger: console.log };
    const app = createApp(dependencies);
    app.use(loggerMiddleware);
    const commandResult = await app.execute(commands);
    const queryResult = await app.execute(query);

    Type parameters

    • D

    Parameters

    • dependencies: D

      Your app dependencies like repositories, logger, database connection, etc...

    Returns DyalApp

    CQRSApp

Generated using TypeDoc