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(stream): removed echo type from emitted census messages type #119

Merged
merged 3 commits into from
Jul 11, 2023

Conversation

microwavekonijn
Copy link
Owner

Echo downgrades the CensusMessage type to any/unknown. This isn't ideal as it negates all type safety. Hence we exclude the echo type. The user can always override the type, like:

streamClient.on('message', (msg: Stream.CensusMessage) => {
  // Do something
});

Caution is still advised when implementing echo messages. Creating a custom types for any echo messages is highly recommended which can then be combined in a union with CensusMessageWithoutEcho message type.

@microwavekonijn microwavekonijn added the enhancement Improvement to existing feature or code label Jul 11, 2023
@microwavekonijn microwavekonijn self-assigned this Jul 11, 2023
@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2023

🦋 Changeset detected

Latest commit: d128d5b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ps2census Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@microwavekonijn microwavekonijn temporarily deployed to test July 11, 2023 11:35 — with GitHub Actions Inactive
@microwavekonijn microwavekonijn merged commit 3b341af into master Jul 11, 2023
@microwavekonijn microwavekonijn deleted the fix/better_ess_message_type branch July 11, 2023 14:16
@github-actions github-actions bot mentioned this pull request Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to existing feature or code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant