myfetchapi
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -45,3 +45,3 @@ "use strict"; | ||
async function myFetch(input, init = {}, options) { | ||
const maxRetry = options?.maxRetry || 3; | ||
const maxRetry = options?.maxRetry === void 0 ? 3 : options.maxRetry === null ? 0 : options.maxRetry; | ||
return new Promise((resolve, reject) => { | ||
@@ -48,0 +48,0 @@ const executeRequest = async (retryCount) => { |
{ | ||
"name": "myfetchapi", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "mFetch is a JavaScript library that provides a utility function for making HTTP requests with queuing and retry functionality.", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
@@ -22,3 +22,7 @@ # myfetchapi | ||
// Make a request | ||
myFetch("https://example.com/api/data", { method: "GET" }, { maxRetry: 3 }) | ||
myFetch( | ||
"https://example.com/api/data", | ||
{ method: "GET" }, | ||
{ maxRetry: 5 /* default is 3. To disable retries, set it to `null` or `0` */ } | ||
) | ||
.then((response) => console.log(response)) | ||
@@ -25,0 +29,0 @@ .catch((error) => console.error(error)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19673
53