Skip to content

Commit

Permalink
docs(): some comment improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Aug 20, 2020
1 parent a22fd01 commit 71e3e12
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/decorators/command-handler.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import { ICommand } from '../index';
import { COMMAND_HANDLER_METADATA } from './constants';

/**
* CommandHandler handles actions dispatched on `CommandBus`
* @param command `ICommand`
* Decorator that marks a class as a Nest command handler. A command handler
* handles commands (actions) executed by your application code.
*
* The decorated class must implement the `ICommandHandler` interface.
*
* @param command command *type* to be handled by this handler.
*
* @see https://docs.nestjs.com/recipes/cqrs#commands
*/
export const CommandHandler = (command: ICommand): ClassDecorator => {
Expand Down
9 changes: 7 additions & 2 deletions src/decorators/events-handler.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ import { IEvent } from '../index';
import { EVENTS_HANDLER_METADATA } from './constants';

/**
* EventHandler handle dispatched on `EventPublisher`
* @param events List of `IEvent`
* Decorator that marks a class as a Nest event handler. An event handler
* handles events executed by your application code.
*
* The decorated class must implement the `IEventHandler` interface.
*
* @param events one or more event *types* to be handled by this handler.
*
* @see https://docs.nestjs.com/recipes/cqrs#events
*/
export const EventsHandler = (...events: IEvent[]): ClassDecorator => {
Expand Down
8 changes: 7 additions & 1 deletion src/decorators/query-handler.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { IQuery } from '../interfaces';
import { QUERY_HANDLER_METADATA } from './constants';

/**
* QueryHandler's are responsive for the queries dispatch in `QueryBus` and usually used to `reads`
* Decorator that marks a class as a Nest query handler. A query handler
* handles queries executed by your application code.
*
* The decorated class must implement the `IQueryHandler` interface.
*
* @param query query *type* to be handled by this handler.
*
* @see https://docs.nestjs.com/recipes/cqrs#queries
*/
export const QueryHandler = (query: IQuery): ClassDecorator => {
Expand Down
3 changes: 2 additions & 1 deletion src/decorators/saga.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'reflect-metadata';
import { SAGA_METADATA } from './constants';

/**
* Sagas may listen and react for N events
* Decorator that marks a class as a Nest saga. Sagas may listen and react to 1..N events.
*
* @see https://docs.nestjs.com/recipes/cqrs#sagas
*/
export const Saga = (): PropertyDecorator => {
Expand Down

0 comments on commit 71e3e12

Please sign in to comment.