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

Allow injecting the disconnection reason into the decorated parameter #2372

Closed
2 tasks
derevnjuk opened this issue Jul 11, 2023 · 2 comments · Fixed by #2373
Closed
2 tasks

Allow injecting the disconnection reason into the decorated parameter #2372

derevnjuk opened this issue Jul 11, 2023 · 2 comments · Fixed by #2373

Comments

@derevnjuk
Copy link
Contributor

Information

Provide a decorator to handle disconnection reasons in SocketIO services that can be used in conjunction with the $onDisconnect event handler.

@SocketService("/nsp")
export class MyWS {
  public async $onDisconnect(
    @Reason reason: string = ''
  ) {
     // your implementation
  }
}

For details please refer to the Socket.io documentation.

Acceptance criteria

  • The decorator should be used in conjunction with the $onDisconnect event handler.
  • The decorator should allow injecting a single optional parameter of type string.
@github-actions
Copy link

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

@Romakita
Copy link
Collaborator

🎉 This issue has been resolved in version 7.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants