EventSource / eventsource

EventSource client for Node.js and Browser (polyfill)
MIT License
911 stars 252 forks source link

Event() api #282

Closed rejetto closed 2 years ago

rejetto commented 2 years ago

https://github.com/EventSource/eventsource/blob/1b66b9221af1bb8a22b02db5480c0216525a28cf/lib/eventsource.js#L150

Apparently you are passing to Event a second parameter that's not following this documentation: https://dom.spec.whatwg.org/#event

I tried doing the same, and apparently those properties are simply discarded. Should this be considered a bug or what?

rexxars commented 2 years ago

The Event referenced here is not the DOM Event, but rather a custom implementation that sets the additional properties on the event instance: https://github.com/EventSource/eventsource/blob/1b66b9221af1bb8a22b02db5480c0216525a28cf/lib/eventsource.js#L451-L460

Closing this.