-
Is there any decorator which can be used for handling custom events like the following: await this.srv.emit('OrderedBook', { book, quantity, buyer: req.user.id }); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Is it just |
Beta Was this translation helpful? Give feedback.
-
@dragolea how do you handle custom events? |
Beta Was this translation helpful? Give feedback.
-
Regarding this question with the emit await this.srv.emit('OrderedBook', { book, quantity, buyer: req.user.id }); You can use @Inject(SRV) private readonly srv : Service to access the CDS application service which can be used yo have the emit method But currently we do not have a decorator for emit, we plan to have this feature in the near future. |
Beta Was this translation helpful? Give feedback.
Regarding this question with the emit
await this.srv.emit('OrderedBook', { book, quantity, buyer: req.user.id });
You can use @Inject(SRV) private readonly srv : Service to access the CDS application service which can be used yo have the emit method
But currently we do not have a decorator for emit, we plan to have this feature in the near future.