Skip to content

Commit

Permalink
feat: allow microserivce event or message extras to be extended
Browse files Browse the repository at this point in the history
  • Loading branch information
effervescentia committed Apr 4, 2023
1 parent e33cf19 commit fd070b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/microservices/decorators/event-pattern.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export const EventPattern: {
descriptor.value,
);
Reflect.defineMetadata(TRANSPORT_METADATA, transport, descriptor.value);
Reflect.defineMetadata(PATTERN_EXTRAS_METADATA, extras, descriptor.value);
Reflect.defineMetadata(
PATTERN_EXTRAS_METADATA,
{
...Reflect.getMetadata(PATTERN_EXTRAS_METADATA, descriptor.value),
...extras,
},
descriptor.value,
);
return descriptor;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ export const MessagePattern: {
descriptor.value,
);
Reflect.defineMetadata(TRANSPORT_METADATA, transport, descriptor.value);
Reflect.defineMetadata(PATTERN_EXTRAS_METADATA, extras, descriptor.value);
Reflect.defineMetadata(
PATTERN_EXTRAS_METADATA,
{
...Reflect.getMetadata(PATTERN_EXTRAS_METADATA, descriptor.value),
...extras,
},
descriptor.value,
);
return descriptor;
};
};
Expand Down

0 comments on commit fd070b8

Please sign in to comment.