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

Add types to emitted events for Session and Channel #27

Closed MatthewWid closed 2 years ago

MatthewWid commented 2 years ago

Add types to the Session and Channel classes that add overloads to their EventEmitter-inherited methods which give types to the event arguments.

For example, right now consumers of Channel events such as session-registered and session-deregistered must manually set the type of the event argument session to as Session. This could be enhanced by overloading callbacks with these event names to automatically set the argument types for the user.

MatthewWid commented 2 years ago

Resolved by #28.