- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 support for the EventTarget once
option
#1754
Conversation
Well, the whole Do you really need this feature? In Node.js you can use |
well to build an hybrid node/web client you wouldn't know if you can use |
Also this need tests (also for |
The documentation should also be updated https://github.com/websockets/ws/blob/master/doc/ws.md#websocketaddeventlistenertype-listener. I think it does not worth the effort as it is only useful for the Anyway if you want to add it we have to do it properly. |
Resolved the previous issues, but i'm kinda not very good at testing stuff 😨 |
rip coverage |
As per the documentation this is something not browser related and should be supported to allow transparent polyfill usage https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener ```js import WebSocket from 'ws' new WebSocket().addEventListener('message', () => {}, { once: true }) ```
This reverts commit 697ed9b.
Thank you. |
As per the documentation this is something not browser related and should be supported to allow transparent polyfill usage
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener