-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(useEventSource): add serializer
#4953
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
Conversation
Thank you for your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far. Some small adjustments.
Maybe we should rename it to: serializer
like useBase64
Thank you! |
There are no new commits. Maybe you forgot to push 😅 |
I forgot last time. Could you please do the code review again? |
how about now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Thank you!
…he other composables
@vueuse/components
@vueuse/core
@vueuse/electron
@vueuse/firebase
@vueuse/integrations
@vueuse/math
@vueuse/metadata
@vueuse/nuxt
@vueuse/router
@vueuse/rxjs
@vueuse/shared
commit: |
this looks good, but its actually deserialising, right? it is taking the data from the event and deserialising it. afaik, event source data is always a string and its upto the consumer to deserialise it if this is the case, we should probably either call it @OrbisK thoughts? |
Yeah, you're right.
I like the idea of having only the |
👍 that works for me, these 3 functions can share roughly the same serialisation type then, which would be nice |
@imddc would you mind changing this one more time? 😅 |
I have modified the code. Please review it again |
serializer
Before submitting the PR, please make sure you do the following
fixes #123
).Description
Additional context
This enhancement addresses a common pain point when working with EventSource APIs that send JSON data as strings, requiring manual parsing in every usage. The implementation follows VueUse's existing patterns and maintains full backward compatibility.