nest-emitter
nest-emitter copied to clipboard
For the .on, do we need to specify that it's async?
this.emitter.on('notification', async msg => await this.onNotification(msg));
Can I just do:
this.emitter.on('notification', this.onNotification);
I'm not sure what benefit the async
offers?
+1. Also, does this library support await for event handlers? As I understand, for now it just causes promise loose.
Also, why should it be defined inside onModuleInit
and not just inside the constructor?