Decorator to register a class as a command with a unique identifier.
The @Command decorator marks a class as a command and assigns it a unique ID
that can be used for command lookup, registration, and execution. This decorator
is essential for the command pattern implementation and enables type-safe command
creation through the CommandRegistry.
Returns
Decorator function that registers the command class
// Register in CommandRegistry for type safety declaremodule'@limetech/lime-web-components' { interfaceCommandRegistry { 'generate-pdf-report': GeneratePdfReportCommand; 'archive-deal': ArchiveDealCommand; 'bulk-update-status': BulkUpdateStatusCommand; } }
// Now you can use createCommand with type safety constcommand = commandBus.createCommand({ id:'generate-pdf-report', params: { reportType:'monthly', includeCharts:true } });
Decorator to register a class as a command with a unique identifier.
The
@Commanddecorator marks a class as a command and assigns it a unique ID that can be used for command lookup, registration, and execution. This decorator is essential for the command pattern implementation and enables type-safe command creation through the CommandRegistry.Returns
Decorator function that registers the command class
Example
Example
Example
Example