@hyper-fetch/core 7.4.1 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyper-fetch/core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.1",
|
|
4
4
|
"description": "Cache, Queue and Persist your requests no matter if you are online or offline!",
|
|
5
5
|
"author": "Maciej Pyrc <maciekpyrc@gmail.com>, Kacper Skawina <kacper.skawina@gmail.com>",
|
|
6
6
|
"homepage": "https://hyperfetch.bettertyped.com/",
|
|
@@ -41,8 +41,9 @@ export const getAdapter = () =>
|
|
|
41
41
|
onRequestProgress,
|
|
42
42
|
onSuccess,
|
|
43
43
|
}) => {
|
|
44
|
-
const { method, client, endpoint } = request;
|
|
45
|
-
const
|
|
44
|
+
const { method, client, endpoint, queryParams } = request;
|
|
45
|
+
const queryString = queryParams ? stringifyQueryParams(queryParams) : "";
|
|
46
|
+
const fullUrl = `${client.url}${endpoint}${queryString}`;
|
|
46
47
|
const xhr = new XMLHttpRequest();
|
|
47
48
|
xhr.timeout = defaultTimeout;
|
|
48
49
|
const onAbort = () => xhr.abort();
|
|
@@ -45,7 +45,7 @@ export const getAdapter = () =>
|
|
|
45
45
|
onRequestStart,
|
|
46
46
|
onSuccess,
|
|
47
47
|
}) => {
|
|
48
|
-
const { method, client, endpoint } = request;
|
|
48
|
+
const { method, client, endpoint, queryParams } = request;
|
|
49
49
|
const { url } = client;
|
|
50
50
|
const httpClient = client.url.includes("https://") ? https : http;
|
|
51
51
|
const options = {
|
|
@@ -69,7 +69,8 @@ export const getAdapter = () =>
|
|
|
69
69
|
options.headers["Content-Length"] = Buffer.byteLength(JSON.stringify(payload));
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const
|
|
72
|
+
const queryString = queryParams ? stringifyQueryParams(queryParams) : "";
|
|
73
|
+
const fullUrl = `${url}${endpoint}${queryString}`;
|
|
73
74
|
|
|
74
75
|
const unmountListener = createAbortListener({
|
|
75
76
|
status: 0,
|