Skip to content

feat: expose GlobalOptions type#307

Merged
pi0 merged 3 commits intomainfrom
feat/shared-options
Oct 26, 2023
Merged

feat: expose GlobalOptions type#307
pi0 merged 3 commits intomainfrom
feat/shared-options

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
@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