Created
April 19, 2023 07:53
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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