A DYAL app
const app = createApp(dependencies);const commandBus: CommandBus = createCommandBus();commandBus.register('CountCommand', countCommandHandler);app.on('command').use(commandBus.middleware);export interface CountCommandResult { total: number;}const countCommand: CountCommand = { type: 'command', name: 'CountCommand', payload: { count: 5, },};const result = await app.execute<CountCommandResult>(countCommand);
The useCase to execute.
R
app.on('command').use(commandHandlerMiddleware);
It's the kind of use case your middleware will be called for. Can be query, command or all
query
command
all
app.on('all').use(middleware);
middleware to add to the app stack
void
app.use(middleware);
Generated using TypeDoc
A DYAL app