ublo-lib 1.31.17 → 1.31.19
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.
|
@@ -7,7 +7,7 @@ const buildQueryStringForObject = (key, object) => {
|
|
|
7
7
|
const buildQueryString = params => {
|
|
8
8
|
return Object.keys(params).filter(k => params[k] !== undefined && params[k] !== null).map(k => typeof params[k] === "object" ? buildQueryStringForObject(k, params[k]) : `${k}=${encodeURIComponent(params[k])}`).join("&");
|
|
9
9
|
};
|
|
10
|
-
export const fetcher = method => async (_url, body, params = {}, _headers = {}) => {
|
|
10
|
+
export const fetcher = method => async (_url, body, params = {}, _headers = {}, signal) => {
|
|
11
11
|
const headers = {
|
|
12
12
|
...defaultContentType,
|
|
13
13
|
..._headers
|
|
@@ -18,7 +18,8 @@ export const fetcher = method => async (_url, body, params = {}, _headers = {})
|
|
|
18
18
|
const reqOpts = {
|
|
19
19
|
method: method || "POST",
|
|
20
20
|
headers,
|
|
21
|
-
body: method !== "GET" && body !== undefined ? JSON.stringify(body) : undefined
|
|
21
|
+
body: method !== "GET" && body !== undefined ? JSON.stringify(body) : undefined,
|
|
22
|
+
signal
|
|
22
23
|
};
|
|
23
24
|
const response = await fetch(url, reqOpts);
|
|
24
25
|
if (response.ok && response.status === 204) return undefined;
|