Skip to content
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

Why is Emittery.Typed a separate class? #67

Closed
mmkal opened this issue Nov 23, 2020 · 1 comment · Fixed by #69
Closed

Why is Emittery.Typed a separate class? #67

mmkal opened this issue Nov 23, 2020 · 1 comment · Fixed by #69

Comments

@mmkal
Copy link

mmkal commented Nov 23, 2020

Curious why Typed needs to be a separate class? Couldn't the type signature of the main class just be

class Emittery<EventDataMap extends Events = Events, EmptyEvents extends EventName = never> {
}

to get basically the same result?

@sindresorhus
Copy link
Owner

I don't remember. I tried to look through the original PR, but it didn't really give any insight. I guess it was either lack of TS knowledge or some TS limitation. It would indeed be nice to merge it into the main types.

airhorns added a commit to airhorns/emittery that referenced this issue Nov 29, 2020
…e defaults

I think the extra type is unnecessary, and it's easier to maintain only one of them!

Fixes sindresorhus#67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants