Skip to content

Conversation

jokester
Copy link
Contributor

@jokester jokester commented Feb 18, 2024

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: remove 1 FIXME in code

Current behavior

parentNamespace.adapter be a dummy adapter-like object, and only supports broadcast operation.

New behavior

The same behavior, but with a class that will pass type check.

Other information (e.g. related issues)

When reading the code I saw the FIXME, so I thought the type check can be satisfied this way.

IMO except the type check the inline {broadcast} adapter was not bad. It is arguably better in that unsupported operations will fail loudly instead of silently. So I'm not very confident of this PR. Opinions welcome 🙏🏽 .

To pass type check while preserving the old fail-fast behavior, one could also this.adapter = {broadcast} as Adapter;

@jokester
Copy link
Contributor Author

sorry didn't notice the prettier config. formated that file 👍🏽

@darrachequesne darrachequesne merged commit b9ce6a2 into socketio:main Feb 19, 2024
@darrachequesne
Copy link
Member

@jokester great, thanks 👍

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