andywer / typed-emitter

🔩 Type-safe event emitter interface for TypeScript
MIT License
268 stars 24 forks source link

Reduce eventNames return value #20

Closed Nokel81 closed 2 years ago

Nokel81 commented 2 years ago

It seems strange that eventNames would be the only function to use | sting | symbol. Given that typescript now supports symbols as keys this would be backwards-compatible

andywer commented 2 years ago

Hey @Nokel81, thanks for looking into this!

I had to read into it again, too, but as it turns out, we added this quirk to mitigate type incompatibilities. See #5.

Nokel81 commented 2 years ago

Thanks, I guess I will just do the cast.