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

feat: expose GlobalOptions type #307

Merged
merged 3 commits into from
Oct 26, 2023
Merged

feat: expose GlobalOptions type #307

merged 3 commits into from
Oct 26, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Oct 26, 2023

πŸ”— Linked issue

Resolves #302

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR exposes SharedOptions type, a sub type of FetchOptions that is completely safe to be shared in reusable instances via global configuration. (currently timeout, retry and retryDelay) other things in the future such as respectProxy might be included.

The border between choosing if something is safe to be global option or not is that it should not affect any runtime logic behavior changes.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0
Copy link
Member Author

pi0 commented Oct 26, 2023

/cc @danielroe This does not include retryStatusCodes like nuxt types. More thinking, it can affect runtime behavior of utils when we interpret a response code as valid invalid. Happy to consider adding it if you think would make sense and have global usecases to be configured.

@pi0 pi0 changed the title feat: expose SharedOptions type feat: expose GlobalOptions type Oct 26, 2023
@pi0 pi0 merged commit e82de48 into main Oct 26, 2023
4 checks passed
@pi0 pi0 deleted the feat/shared-options branch October 26, 2023 19:46
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #307 (c3acba4) into main (da64d78) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

❗ Current head c3acba4 differs from pull request most recent head 17f3290. Consider uploading reports for the commit 17f3290 to get more accurate results

@@           Coverage Diff           @@
##             main     #307   +/-   ##
=======================================
  Coverage   92.00%   92.00%           
=======================================
  Files           5        5           
  Lines         450      450           
  Branches      102      102           
=======================================
  Hits          414      414           
  Misses         36       36           

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.

export type for safe global options
1 participant