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(fetch): cache strategy #340

Merged
merged 11 commits into from
Oct 21, 2022
Merged

feat(fetch): cache strategy #340

merged 11 commits into from
Oct 21, 2022

Conversation

alimd
Copy link
Member

@alimd alimd commented Oct 21, 2022

No description provided.

@alimd alimd added major This PR causes a major bump in the version number. new-feature New features or options. breaking-change A change that changes the API or breaks backward compatibility for users. labels Oct 21, 2022
@alimd alimd added this to the v1.0.0-beta milestone Oct 21, 2022
@alimd alimd self-assigned this Oct 21, 2022
const response = await fetch({
url,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
cacheStrategy: document.querySelector<HTMLSelectElement>('#cacheSelect')!.value as CacheStrategy,

Check warning

Code scanning / ESLint

Disallow non-null assertions using the `!` postfix operator

Forbidden non-null assertion.
}
const retryFetch = (): Promise<Response> => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
options.retry!--;

Check warning

Code scanning / ESLint

Disallow non-null assertions using the `!` postfix operator

Forbidden non-null assertion.
clearTimeout(timeoutId);

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (options.retry! > 1 && response.status >= 502 && response.status <= 504) {

Check warning

Code scanning / ESLint

Disallow non-null assertions using the `!` postfix operator

Forbidden non-null assertion.
}
catch (reason) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
if (timedOut && options.retry! > 1) {

Check warning

Code scanning / ESLint

Disallow non-null assertions using the `!` postfix operator

Forbidden non-null assertion.
@alimd alimd merged commit 613ae65 into next Oct 21, 2022
@alimd alimd deleted the feat/fetch branch October 21, 2022 21:57
@github-actions
Copy link

Pull Request closed and locked due to lack of activity.
If you'd like to build on this closed PR, you can clone it using this method: https://stackoverflow.com/a/14969986
Then open a new PR, referencing this closed PR in your message.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change A change that changes the API or breaks backward compatibility for users. major This PR causes a major bump in the version number. new-feature New features or options.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant