Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Migrates [Nexus] service to new service model #2520
Migrates [Nexus] service to new service model #2520
Changes from 3 commits
eb8c0f6
09144a9
c394c8c
eae8940
ad736cc
1b82548
7e96daa
0146680
2292c8c
9a10be1
6833790
fbb7ea9
1c8fb0c
1a31178
5aed5e3
35144bf
28c27f5
a9fc585
c9f38b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 necessary for this PR, though for future reference I've been trying to remove these renames as services are rewritten. (The renames are legacy too.)
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.
This is fine, though for future reference you should know about another pattern we use, which is
transform
. If you delegate this part of the responsibility to atransform
method, you can use afor
loop with areturn
statement which is easier to read.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.
This was another copy/paste from the original implementation. I'm not familiar with
transform
but happy to optimize!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.
Is this an example of the
transform
you are referring to?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.
Yea, that's a good example. We should probably link that from the service-rewriting docs if there isn't already an example of a
transform()
function.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.
This probably would be a bit more direct if it invoked
_requestJson
and was renamed tofetch
. "Fetch" is another pattern we use a lot.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's not obvious from reading this what it's supposed to do. For future reference, stuff like this probably should be its own static method (or function) with a unit test.
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.
Good idea. The original implementation was plugging the query params directly into the
url
, but that was a lot more readable.I'll extract this out into its own function with a comment. 🤦♂️ on the test. Not sure how I forgot that one!