Skip to content

Commit

Permalink
correct order of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Dracks authored Sep 26, 2023
1 parent aa1e784 commit 076c584
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/command-bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ export class CommandBus<CommandBase extends ICommand = ICommand>
this._publisher = _publisher;
}

private getCommandName(command: Type<CommandBase>): string {
const { constructor } = Object.getPrototypeOf(command);
return constructor.name as string;
}

/**
* Executes a command.
* @param command The command to execute.
Expand Down Expand Up @@ -103,6 +98,11 @@ export class CommandBus<CommandBase extends ICommand = ICommand>
return commandMetadata.id;
}

private getCommandName(command: Type<CommandBase>): string {
const { constructor } = Object.getPrototypeOf(command);
return constructor.name as string;
}

private reflectCommandId(handler: CommandHandlerType): string | undefined {
const command: Type<ICommand> = Reflect.getMetadata(
COMMAND_HANDLER_METADATA,
Expand Down

0 comments on commit 076c584

Please sign in to comment.