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

Create .onAny and .onError methods, deprecate "*" and "error" events #304

Closed
gr2m opened this issue Oct 8, 2020 · 2 comments · Fixed by #324
Closed

Create .onAny and .onError methods, deprecate "*" and "error" events #304

gr2m opened this issue Oct 8, 2020 · 2 comments · Fixed by #324
Labels
Type: Feature New feature or request

Comments

@gr2m
Copy link
Contributor

gr2m commented Oct 8, 2020

Follow up to #180

I would reserve the .on(event, handler) method for actual events only, and define new methods for special events that are unique to @octokit/webhooks.

That will also address #302, because we would no longer need to define * and error as part of the overall event map

@gr2m gr2m added the Type: Feature New feature or request label Oct 8, 2020
@ankeetmaini
Copy link
Contributor

I like this approach, as due to this all other types collasce to any and we lose the strong typing. I think with this, we can event type the hook functions as Handler<E, U> instead of plain Function

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 7.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants