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

Remove unnecessary type annotations in examples #3855

Merged

Conversation

MaximeKjaer
Copy link
Contributor

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

socket is inferred as type Socket as of 4.0.0; it was previously inferred as any. The type annotation is no longer needed to cast the any to Socket.

New behavior

The Socket type annotation can be safely removed. The behavior is unchanged, but it's less code.

Other information (e.g. related issues)

Typed events in socket.io 4.0 remove the need for writing type annotations in callbacks of reserved events.

Typed events in socket.io 4.0 remove the need for writing type
annotations in callbacks of reserved events.
@MaximeKjaer MaximeKjaer mentioned this pull request Mar 23, 2021
5 tasks
@darrachequesne darrachequesne merged commit 259f297 into socketio:master Mar 24, 2021
@darrachequesne
Copy link
Member

Good catch, thanks!

@MaximeKjaer MaximeKjaer deleted the remove-unnecessary-annotation branch March 25, 2021 16:46
dzad pushed a commit to dzad/socket.io that referenced this pull request May 29, 2023
Typed events in Socket.IO 4.0 remove the need for writing type
annotations in callbacks of reserved events.
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

Successfully merging this pull request may close these issues.

2 participants