Refactor getReadTheDocsConfig to use Promise#286
Merged
humitos merged 4 commits intohumitos/custom-eventfrom Apr 15, 2024
Merged
Refactor getReadTheDocsConfig to use Promise#286humitos merged 4 commits intohumitos/custom-eventfrom
getReadTheDocsConfig to use Promise#286humitos merged 4 commits intohumitos/custom-eventfrom
Conversation
Follow Anthony's suggestion from #64 (comment)
getReadTheDocsConfig to use `PromisegetReadTheDocsConfig to use Promise
agjohnson
reviewed
Apr 10, 2024
agjohnson
reviewed
Apr 10, 2024
I found a pattern that I like 👍🏼 . I think it's a clear way to communicate users what's going on, but also leaves the door open to expand checks/validations in the future. I also imagine we could even want to know "What projects are subscribing to the custom event?" in case we need to contact them due to a breaking change or similar. ## Examples #### Calling `event.detail.initialize()` without having defined the `<meta ... />` HTML tag:  #### Calling `event.detail.data()` without calling `.initialize()` first:  Closes #279
Member
Author
|
OK. I re-structured how we are calling the |
agjohnson
approved these changes
Apr 12, 2024
Contributor
agjohnson
left a comment
There was a problem hiding this comment.
This looks good, the logic matches what I would expect 👍
| return url; | ||
| } | ||
|
|
||
| function getReadTheDocsUserConfig(sendUrlParam) { |
Contributor
There was a problem hiding this comment.
Breaking this out is a good idea 👍 Often, splitting up nested async/promises makes the code easier to follow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow Anthony's suggestion from
#64 (comment)