Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For the .on, do we need to specify that it's async? #30

Open
shamoons opened this issue May 28, 2020 · 2 comments
Open

For the .on, do we need to specify that it's async? #30

shamoons opened this issue May 28, 2020 · 2 comments

Comments

@shamoons
Copy link

    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?

@DenKorn
Copy link

DenKorn commented Oct 19, 2020

+1.
Also, does this library support await for event handlers? As I understand, for now it just causes promise loose.

@reinoute
Copy link

Also, why should it be defined inside onModuleInit and not just inside the constructor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants