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

Fix up types for cached and returned data. #84

Merged
merged 1 commit into from
Nov 17, 2022
Merged

Fix up types for cached and returned data. #84

merged 1 commit into from
Nov 17, 2022

Conversation

lgarron
Copy link
Contributor

@lgarron lgarron commented Nov 16, 2022

.#getData() had the type Promise<string>, but this is inaccurate. It could also return:

  1. string
  2. Error

This all sort of stems from the privateData Map, which did not have template types.

This PR adds an async keyword to avoid the first case, and adds additional types for the second case. This has consequences across quite a few methods, so I've split the PR out from #81 for separate discussion.

@lgarron lgarron requested a review from a team as a code owner November 16, 2022 20:56
@primer-css
Copy link

👋 Hello and thanks for pinging us! This issue or PR has been added to our inbox and a Design Infrastructure first responder will review it soon.

  • 🎨 If this is a PR that includes a visual change, please make sure to add screenshots in the description or deploy this code to a lab machine with instructions for how to test.
  • If this is a PR that includes changes to an interaction, please include a video recording in the description.
  • ⚠️ If this is urgent, please visit us in #primer on Slack and tag the first responders listed in the channel topic.

@lgarron lgarron merged commit 538b108 into github:main Nov 17, 2022
@lgarron lgarron deleted the lgarron/cached-data-types branch November 17, 2022 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants