Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bogdanovna/f6524ef71a6cf61a9079685d793eabee to your computer and use it in GitHub Desktop.
Save bogdanovna/f6524ef71a6cf61a9079685d793eabee to your computer and use it in GitHub Desktop.
Force to use patterns as method names so it is possible to protect them with typescript.
import { EventPattern } from '@nestjs/microservices';
export function EventPatternByMethodName() {
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
EventPattern(propertyKey)(target, propertyKey, descriptor);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment