Skip to content

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.

4 participants