@ethlete/query 2.7.0 → 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.
- package/esm2020/lib/directives/infinity-query-trigger.directive.mjs +3 -3
- package/esm2020/lib/directives/infinity-query.directive.mjs +3 -3
- package/esm2020/lib/directives/query.directive.mjs +3 -3
- package/esm2020/lib/infinite-query/infinity-query.mjs +2 -9
- package/esm2020/lib/query/query.mjs +7 -5
- package/esm2020/lib/request/request.mjs +2 -8
- package/fesm2015/ethlete-query.mjs +17 -28
- package/fesm2015/ethlete-query.mjs.map +1 -1
- package/fesm2020/ethlete-query.mjs +17 -28
- package/fesm2020/ethlete-query.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -1243,9 +1239,9 @@ class QueryDirective {
|
|
|
1243
1239
|
}
|
|
1244
1240
|
}
|
|
1245
1241
|
}
|
|
1246
|
-
QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1247
|
-
QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1248
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1242
|
+
QueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: QueryDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ErrorHandler }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1243
|
+
QueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: QueryDirective, isStandalone: true, selector: "[query]", inputs: { query: "query", cache: ["queryCache", "cache"] }, ngImport: i0 });
|
|
1244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: QueryDirective, decorators: [{
|
|
1249
1245
|
type: Directive,
|
|
1250
1246
|
args: [{
|
|
1251
1247
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -1384,14 +1380,7 @@ class InfinityQuery {
|
|
|
1384
1380
|
this._subscriptions = this._subscriptions.filter((sub) => sub !== stateChangesSub);
|
|
1385
1381
|
},
|
|
1386
1382
|
});
|
|
1387
|
-
|
|
1388
|
-
next: (state) => {
|
|
1389
|
-
if (state.meta.triggeredVia === 'auto') {
|
|
1390
|
-
this.reset();
|
|
1391
|
-
}
|
|
1392
|
-
},
|
|
1393
|
-
});
|
|
1394
|
-
this._subscriptions.push(stateChangesSub, queryAutoRefreshSub);
|
|
1383
|
+
this._subscriptions.push(stateChangesSub);
|
|
1395
1384
|
}
|
|
1396
1385
|
_prepareArgs(config, page) {
|
|
1397
1386
|
const pageParamLocation = this._getPageParamLocation(config?.pageParam?.location);
|
|
@@ -1597,9 +1586,9 @@ class InfinityQueryDirective {
|
|
|
1597
1586
|
this._data$.next([]);
|
|
1598
1587
|
}
|
|
1599
1588
|
}
|
|
1600
|
-
InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1601
|
-
InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1602
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1589
|
+
InfinityQueryDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: InfinityQueryDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1590
|
+
InfinityQueryDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: InfinityQueryDirective, isStandalone: true, selector: "[infinityQuery]", inputs: { infinityQuery: "infinityQuery" }, providers: [{ provide: INFINITY_QUERY_TOKEN, useExisting: InfinityQueryDirective }, DestroyService], exportAs: ["infinityQuery"], ngImport: i0 });
|
|
1591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: InfinityQueryDirective, decorators: [{
|
|
1603
1592
|
type: Directive,
|
|
1604
1593
|
args: [{
|
|
1605
1594
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -1649,9 +1638,9 @@ class InfinityQueryTriggerDirective {
|
|
|
1649
1638
|
this._observer.observe(this._elementRef.nativeElement);
|
|
1650
1639
|
}
|
|
1651
1640
|
}
|
|
1652
|
-
InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1653
|
-
InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1654
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1641
|
+
InfinityQueryTriggerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: InfinityQueryTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1642
|
+
InfinityQueryTriggerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: InfinityQueryTriggerDirective, isStandalone: true, selector: "[infinityQueryTrigger], infinity-query-trigger", inputs: { scrollContainerSelector: "scrollContainerSelector" }, ngImport: i0 });
|
|
1643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: InfinityQueryTriggerDirective, decorators: [{
|
|
1655
1644
|
type: Directive,
|
|
1656
1645
|
args: [{
|
|
1657
1646
|
// eslint-disable-next-line @angular-eslint/directive-selector
|