denosaurs / event

📆 Strictly typed event emitter with asynciterator support
https://deno.land/x/event
MIT License
42 stars 5 forks source link

.close() type conflict #1

Closed talentlessguy closed 3 years ago

talentlessguy commented 3 years ago

Hello!

I'm working on node_http, a Node.js-like HTTP server and I need to implement Server.close() method. However, EventEmitter already contains .close() method.

My suggestion would be renaming .close() to removeAllListeners()

ref: https://nodejs.org/dist/latest-v12.x/docs/api/events.html#events_emitter_removealllisteners_eventname

crowlKats commented 3 years ago

close is different from off (which is the equivalent of removeAllListeners when no args are passed). I agree the name for close should be changed though, or maybe close be merged into off

crowlKats commented 3 years ago

Fixed in 125dc6f3de085ecdad26d02a379e205495813359