import { Command } from '../../domain/Command' ; import { CommandBus } from './../../domain/CommandBus' ; import { CommandHandlersInformation } from './CommandHandlersInformation' ; export class InMemoryCommandBus implements CommandBus { constructor ( private commandHandlersInformation ) { } async dispatch ( command ) { const handler = this . commandHandlersInformation . search ( command ) ; await handler . handle ( command ) ; } }