@ethlete/query 2.7.1 → 2.7.3

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
- headerResponse = { headers, status: xhr.status, statusText, url: _url };
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
- response: newData,
797
- rawResponse: newData,
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
  }
@@ -1637,7 +1633,7 @@ class InfinityQueryTriggerDirective {
1637
1633
  }, {
1638
1634
  root: this.scrollContainerSelector ? document.querySelector(this.scrollContainerSelector) : null,
1639
1635
  rootMargin: '0px',
1640
- threshold: 1.0,
1636
+ threshold: [0.25, 0.5, 0.75, 1],
1641
1637
  });
1642
1638
  this._observer.observe(this._elementRef.nativeElement);
1643
1639
  }