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

set default value of "event" to "message" #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fawadasaurus
Copy link

https://developer.mozilla.org/en-US/docs/Web/API/EventSource#

image

Other language parsers behave consistently and set the value of event to message when the event does not exist.

@rexxars
Copy link
Owner

rexxars commented Oct 12, 2023

Thank you! I'm slightly torn on this, since this library is a parser and not a client. By defaulting event to message, we have no way of knowing whether or not an event name was specified. Not sure if there are many cases where that matters - will give it some thought.

In any case, if we do decide to default to message, the event property should no longer be typed as event?: string, but as event: string

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.

None yet

2 participants