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

Add dispatchEvent to EventSource #101

Merged

Conversation

afroozeh
Copy link
Contributor

Adds dispatchEvent method to EventSource to make it compatible with the EventSource definition form https://developer.mozilla.org/en-US/docs/Web/API/EventSource.

EventSource extends EventTarget that has the dispatchEvent method:
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/dispatchEvent

The Event and CustomEvent objects are only available in DOM, so I tried to simulate them by { type: string} and {type: string, detail: object} object literals:

https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Creating_and_triggering_events

@afroozeh afroozeh force-pushed the add-eventdispatch-to-eventsource branch from fd80b3d to f78f08f Compare May 22, 2018 22:48
@rexxars
Copy link
Member

rexxars commented Aug 24, 2018

This looks good to me, any objections, @piranna or @aslakhellesoy ?

Copy link
Contributor

@aslakhellesoy aslakhellesoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

4 participants