MatthewWid / better-sse

⬆ Dead simple, dependency-less, spec-compliant server-sent events implementation for Node, written in TypeScript.
MIT License
485 stars 14 forks source link

Re-order session and channel event arguments #29

Closed MatthewWid closed 2 years ago

MatthewWid commented 2 years ago

This PR re-orders the Session#push and Channel#broadcast methods to always have the event data first and event name as an optional second argument. In addition, it also allows the user to set a custom event ID as an optional third argument to the Session#push method and adds a new push event emitted by Session after the Session#push method is called.