@ethlete/query 2.7.1 → 2.7.2
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.
|
@@ -320,9 +320,7 @@ const request = (config) => {
|
|
|
320
320
|
return new Observable((observer) => {
|
|
321
321
|
const xhr = new XMLHttpRequest();
|
|
322
322
|
const reqBody = serializeBody(body);
|
|
323
|
-
let headerResponse = null;
|
|
324
323
|
const setupXhr = () => {
|
|
325
|
-
headerResponse = null;
|
|
326
324
|
xhr.open(config.method, config.urlWithParams);
|
|
327
325
|
if (config.withCredentials) {
|
|
328
326
|
xhr.withCredentials = true;
|
|
@@ -341,14 +339,10 @@ const request = (config) => {
|
|
|
341
339
|
};
|
|
342
340
|
setupXhr();
|
|
343
341
|
const partialFromXhr = () => {
|
|
344
|
-
if (headerResponse !== null) {
|
|
345
|
-
return headerResponse;
|
|
346
|
-
}
|
|
347
342
|
const statusText = xhr.statusText || 'OK';
|
|
348
343
|
const headers = parseAllXhrResponseHeaders(xhr);
|
|
349
344
|
const _url = getResponseUrl(xhr) || url;
|
|
350
|
-
|
|
351
|
-
return headerResponse;
|
|
345
|
+
return { headers, status: xhr.status, statusText, url: _url };
|
|
352
346
|
};
|
|
353
347
|
const handleRetry = (error) => {
|
|
354
348
|
const newRetryCount = currentRetryCount + 1;
|
|
@@ -792,10 +786,12 @@ class Query {
|
|
|
792
786
|
rawResponse,
|
|
793
787
|
response,
|
|
794
788
|
})
|
|
795
|
-
:
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
789
|
+
: response[key] === newData[key]
|
|
790
|
+
? {
|
|
791
|
+
response: newData,
|
|
792
|
+
rawResponse: newData,
|
|
793
|
+
}
|
|
794
|
+
: null;
|
|
799
795
|
if (!newResponse) {
|
|
800
796
|
return;
|
|
801
797
|
}
|