@nestjs/microservices
Version:
Nest - modern, fast, powerful node.js web framework (@microservices)
17 lines (16 loc) • 536 B
JavaScript
import { CLIENT_CONFIGURATION_METADATA, CLIENT_METADATA, } from '../constants.js';
/**
* Attaches the `ClientProxy` instance to the given property
*
* @param {ClientOptions} metadata optional client metadata
*
* @publicApi
*
*/
export function Client(metadata) {
return (target, propertyKey) => {
Reflect.set(target, propertyKey, null);
Reflect.defineMetadata(CLIENT_METADATA, true, target, propertyKey);
Reflect.defineMetadata(CLIENT_CONFIGURATION_METADATA, metadata, target, propertyKey);
};
}