Skip to content

Commit 53a9cda

Browse files
authored
Update event-emitter.mdx
1 parent daaadde commit 53a9cda

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/platforms/javascript/guides/nestjs/features/event-emitter.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ The NestJS SDK wraps the `@OnEvent` decorator automatically to:
1616
When an event handler is executed, a new span is created to track its performance, and any errors are automatically reported to Sentry while preserving the original error behavior.
1717

1818
<Alert level="info" title="Multiple decorators">
19-
Annotating one function with multiple `@OnEvent` decorators is not recommended, as NestJS provides no way for us to determine the triggering event. Therefore, the resulting span name will include all decorated event names.
20-
21-
Instead, use one decorator per event name and handle any shared logic through a separate function.
19+
If multiple decorators are used, we will collect all event names to determine the span's name.
20+
In case you want to map each event to a specific handler, use one decorator per handler and handle any shared logic through a separate function.
2221

2322
```typescript
2423
@OnEvent('event.A')

0 commit comments

Comments
 (0)