-
Notifications
You must be signed in to change notification settings - Fork 5
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
split event handlers #227
split event handlers #227
Conversation
constructor(message: string = "Something went wrong with event handler data") { | ||
super(message); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like it would be considerably simpler, if the handlers were context-free, and the ctx, payload, octokit, parsedCommand
would be normal arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i started making it like this, but then too many things could be re-used, so I made it like this. Ultimately there are downsides and things that could look better in both approaches imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of .bind(this)
, but won't object merging
To simplify the onIssueCommentCreated.ts handler I have split it into more granular parts
I wanted to store handlers in different files so it's easier to navigate