-
Notifications
You must be signed in to change notification settings - Fork 399
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
Fix #1376 CustomRoute interface should be accessible from developers #1393
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1393 +/- ##
=======================================
Coverage 77.12% 77.12%
=======================================
Files 17 17
Lines 1460 1460
Branches 432 432
=======================================
Hits 1126 1126
Misses 236 236
Partials 98 98
Continue to review full report at Codecov.
|
@@ -13,7 +13,7 @@ export interface ReceiverRoutes { | |||
}; | |||
} | |||
|
|||
export function prepareRoutes(customRoutes: CustomRoute[]): ReceiverRoutes { | |||
export function buildReceiverRoutes(customRoutes: CustomRoute[]): ReceiverRoutes { |
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.
Either is fine but, to me, the name build
indicates the nuance that this method does not side effects much more.
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 have always had a problem with using prepare
to describe functionality. Unless one is familiar with the algorithm already, it is not descriptive to an outsider!
I am OK with buildReceiverRoutes
. I also think attachReceiverRoutes
or bindReceiverRoutes
would be acceptable.
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.
Thanks for the suggestions. I think that we can go with "build" for this
export { | ||
CustomRoute, | ||
ReceiverRoutes, | ||
buildReceiverRoutes, |
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.
For developers that create their own receivers, exposing not only the types but also the builder method would be helpful.
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.
!
@@ -13,7 +13,7 @@ export interface ReceiverRoutes { | |||
}; | |||
} | |||
|
|||
export function prepareRoutes(customRoutes: CustomRoute[]): ReceiverRoutes { | |||
export function buildReceiverRoutes(customRoutes: CustomRoute[]): ReceiverRoutes { |
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 have always had a problem with using prepare
to describe functionality. Unless one is familiar with the algorithm already, it is not descriptive to an outsider!
I am OK with buildReceiverRoutes
. I also think attachReceiverRoutes
or bindReceiverRoutes
would be acceptable.
Summary
This pull request resolves #1376 by exporting the two types and one method from
./receivers/custom-routes
.Requirements (place an
x
in each[ ]
)