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

feat(socketio): allow injecting the disconnection reason #2373

Conversation

derevnjuk
Copy link
Contributor

Information

Type Breaking change
Feature No

Usage example

This decorator is used in conjunction with the $onDisconnect event handler to handle disconnection reasons in SocketIO services.
It allows you to access the reason for the disconnection in your method implementation. For details please refer to the Socket.io documentation.

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

Todos

  • Tests
  • Coverage
  • Example
  • Documentation

closes #2372

@derevnjuk derevnjuk self-assigned this Jul 11, 2023
@derevnjuk derevnjuk force-pushed the feat_#2372/allow_injecting_the_disconnection_reason_into_the_decorated_parameter branch 2 times, most recently from f9bd26d to 26bfc0d Compare July 11, 2023 11:45
@derevnjuk derevnjuk marked this pull request as ready for review July 11, 2023 11:46
@derevnjuk derevnjuk force-pushed the feat_#2372/allow_injecting_the_disconnection_reason_into_the_decorated_parameter branch from 26bfc0d to da070d0 Compare July 11, 2023 13:22
@derevnjuk derevnjuk requested a review from Romakita July 11, 2023 13:22
@Romakita
Copy link
Collaborator

Hello @derevnjuk
Just only one cosmetic change ;)

Really nice PR!

@Romakita
Copy link
Collaborator

Go to merge ;)

@derevnjuk derevnjuk merged commit e5227e2 into tsedio:production Jul 11, 2023
@derevnjuk derevnjuk deleted the feat_#2372/allow_injecting_the_disconnection_reason_into_the_decorated_parameter branch July 11, 2023 18:15
@Romakita
Copy link
Collaborator

🎉 This PR is included 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 this pull request may close these issues.

Allow injecting the disconnection reason into the decorated parameter
2 participants