@ngrx/data 12.3.0 → 13.0.0-beta.0
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/bundles/ngrx-data.umd.js +416 -343
- package/bundles/ngrx-data.umd.js.map +1 -1
- package/esm2015/ngrx-data.js +1 -2
- package/esm2015/src/actions/entity-action-factory.js +7 -4
- package/esm2015/src/dataservices/default-data.service.js +13 -13
- package/esm2015/src/dataservices/entity-cache-data.service.js +12 -13
- package/esm2015/src/dataservices/entity-data.service.js +8 -9
- package/esm2015/src/dataservices/http-url-generator.js +8 -9
- package/esm2015/src/dataservices/persistence-result-handler.service.js +9 -11
- package/esm2015/src/dispatchers/entity-cache-dispatcher.js +16 -15
- package/esm2015/src/dispatchers/entity-dispatcher-default-options.js +7 -4
- package/esm2015/src/dispatchers/entity-dispatcher-factory.js +19 -18
- package/esm2015/src/effects/entity-cache-effects.js +17 -16
- package/esm2015/src/effects/entity-effects.js +17 -16
- package/esm2015/src/entity-data-without-effects.module.js +77 -43
- package/esm2015/src/entity-data.module.js +47 -29
- package/esm2015/src/entity-metadata/entity-definition.service.js +12 -8
- package/esm2015/src/entity-services/entity-collection-service-elements-factory.js +11 -15
- package/esm2015/src/entity-services/entity-collection-service-factory.js +8 -9
- package/esm2015/src/entity-services/entity-services-base.js +8 -9
- package/esm2015/src/entity-services/entity-services-elements.js +11 -15
- package/esm2015/src/reducers/entity-cache-reducer.js +10 -13
- package/esm2015/src/reducers/entity-collection-creator.js +10 -9
- package/esm2015/src/reducers/entity-collection-reducer-methods.js +8 -9
- package/esm2015/src/reducers/entity-collection-reducer-registry.js +13 -10
- package/esm2015/src/reducers/entity-collection-reducer.js +8 -9
- package/esm2015/src/selectors/entity-selectors$.js +12 -12
- package/esm2015/src/selectors/entity-selectors.js +15 -9
- package/esm2015/src/utils/correlation-id-generator.js +7 -4
- package/esm2015/src/utils/default-logger.js +7 -4
- package/esm2015/src/utils/default-pluralizer.js +12 -8
- package/fesm2015/ngrx-data.js +313 -281
- package/fesm2015/ngrx-data.js.map +1 -1
- package/ngrx-data.d.ts +1 -1
- package/package.json +8 -9
- package/schematics-core/index.js +2 -1
- package/schematics-core/index.js.map +1 -1
- package/schematics-core/utility/libs-version.js +1 -1
- package/schematics-core/utility/libs-version.js.map +1 -1
- package/schematics-core/utility/ngrx-utils.js +7 -1
- package/schematics-core/utility/ngrx-utils.js.map +1 -1
- package/src/actions/entity-action-factory.d.ts +3 -0
- package/src/dataservices/default-data.service.d.ts +3 -0
- package/src/dataservices/entity-cache-data.service.d.ts +3 -0
- package/src/dataservices/entity-data.service.d.ts +3 -0
- package/src/dataservices/http-url-generator.d.ts +3 -0
- package/src/dataservices/persistence-result-handler.service.d.ts +3 -0
- package/src/dispatchers/entity-cache-dispatcher.d.ts +3 -0
- package/src/dispatchers/entity-dispatcher-default-options.d.ts +3 -0
- package/src/dispatchers/entity-dispatcher-factory.d.ts +3 -0
- package/src/effects/entity-cache-effects.d.ts +3 -0
- package/src/effects/entity-effects.d.ts +3 -0
- package/src/entity-data-without-effects.module.d.ts +5 -0
- package/src/entity-data.module.d.ts +6 -0
- package/src/entity-metadata/entity-definition.service.d.ts +3 -0
- package/src/entity-services/entity-collection-service-base.d.ts +1 -1
- package/src/entity-services/entity-collection-service-elements-factory.d.ts +3 -0
- package/src/entity-services/entity-collection-service-factory.d.ts +3 -0
- package/src/entity-services/entity-services-base.d.ts +3 -0
- package/src/entity-services/entity-services-elements.d.ts +3 -0
- package/src/reducers/entity-cache-reducer.d.ts +3 -0
- package/src/reducers/entity-collection-creator.d.ts +3 -0
- package/src/reducers/entity-collection-reducer-methods.d.ts +3 -0
- package/src/reducers/entity-collection-reducer-registry.d.ts +3 -0
- package/src/reducers/entity-collection-reducer.d.ts +3 -0
- package/src/selectors/entity-selectors$.d.ts +3 -0
- package/src/selectors/entity-selectors.d.ts +3 -0
- package/src/utils/correlation-id-generator.d.ts +3 -0
- package/src/utils/default-logger.d.ts +3 -0
- package/src/utils/default-pluralizer.d.ts +3 -0
- package/ngrx-data.metadata.json +0 -1
package/bundles/ngrx-data.umd.js
CHANGED
|
@@ -2,7 +2,33 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/operators'), require('@angular/common/http'), require('rxjs'), require('@ngrx/entity'), require('@ngrx/store'), require('@ngrx/effects')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@ngrx/data', ['exports', '@angular/core', 'rxjs/operators', '@angular/common/http', 'rxjs', '@ngrx/entity', '@ngrx/store', '@ngrx/effects'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ngrx = global.ngrx || {}, global.ngrx.data = {}), global.ng.core, global.rxjs.operators, global.ng.common.http, global.rxjs, global.ngrx.entity, global.ngrx.store, global.ngrx.effects));
|
|
5
|
-
}(this, (function (exports,
|
|
5
|
+
}(this, (function (exports, i0, operators, i1, i4, entity, i1$1, i1$2) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return e[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n['default'] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
29
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
30
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
31
|
+
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
6
32
|
|
|
7
33
|
var EntityActionFactory = /** @class */ (function () {
|
|
8
34
|
function EntityActionFactory() {
|
|
@@ -10,8 +36,7 @@
|
|
|
10
36
|
// polymorphic create for the two signatures
|
|
11
37
|
EntityActionFactory.prototype.create = function (nameOrPayload, entityOp, data, options) {
|
|
12
38
|
var payload = typeof nameOrPayload === 'string'
|
|
13
|
-
? Object.assign(Object.assign({}, (options || {})), { entityName: nameOrPayload, entityOp: entityOp,
|
|
14
|
-
data: data })
|
|
39
|
+
? Object.assign(Object.assign({}, (options || {})), { entityName: nameOrPayload, entityOp: entityOp, data: data })
|
|
15
40
|
: nameOrPayload;
|
|
16
41
|
return this.createCore(payload);
|
|
17
42
|
};
|
|
@@ -45,9 +70,11 @@
|
|
|
45
70
|
};
|
|
46
71
|
return EntityActionFactory;
|
|
47
72
|
}());
|
|
48
|
-
EntityActionFactory
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
/** @nocollapse */ EntityActionFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityActionFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
74
|
+
/** @nocollapse */ EntityActionFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityActionFactory });
|
|
75
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityActionFactory, decorators: [{
|
|
76
|
+
type: i0.Injectable
|
|
77
|
+
}] });
|
|
51
78
|
|
|
52
79
|
/**
|
|
53
80
|
* Guard methods that ensure EntityAction payload is as expected.
|
|
@@ -410,10 +437,16 @@
|
|
|
410
437
|
r[k] = a[j];
|
|
411
438
|
return r;
|
|
412
439
|
}
|
|
413
|
-
function __spreadArray(to, from) {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
440
|
+
function __spreadArray(to, from, pack) {
|
|
441
|
+
if (pack || arguments.length === 2)
|
|
442
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
443
|
+
if (ar || !(i in from)) {
|
|
444
|
+
if (!ar)
|
|
445
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
446
|
+
ar[i] = from[i];
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
417
450
|
}
|
|
418
451
|
function __await(v) {
|
|
419
452
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -920,7 +953,7 @@
|
|
|
920
953
|
}
|
|
921
954
|
return Logger;
|
|
922
955
|
}());
|
|
923
|
-
var PLURAL_NAMES_TOKEN = new
|
|
956
|
+
var PLURAL_NAMES_TOKEN = new i0.InjectionToken('@ngrx/data Plural Names');
|
|
924
957
|
var Pluralizer = /** @class */ (function () {
|
|
925
958
|
function Pluralizer() {
|
|
926
959
|
}
|
|
@@ -1005,13 +1038,11 @@
|
|
|
1005
1038
|
};
|
|
1006
1039
|
return DefaultHttpUrlGenerator;
|
|
1007
1040
|
}());
|
|
1008
|
-
DefaultHttpUrlGenerator
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
{ type: Pluralizer }
|
|
1014
|
-
]; };
|
|
1041
|
+
/** @nocollapse */ DefaultHttpUrlGenerator.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultHttpUrlGenerator, deps: [{ token: Pluralizer }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1042
|
+
/** @nocollapse */ DefaultHttpUrlGenerator.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultHttpUrlGenerator });
|
|
1043
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultHttpUrlGenerator, decorators: [{
|
|
1044
|
+
type: i0.Injectable
|
|
1045
|
+
}], ctorParameters: function () { return [{ type: Pluralizer }]; } });
|
|
1015
1046
|
/** Remove leading & trailing spaces or slashes */
|
|
1016
1047
|
function normalizeRoot(root) {
|
|
1017
1048
|
return root.replace(/^[/\s]+|[/\s]+$/g, '');
|
|
@@ -1073,7 +1104,7 @@
|
|
|
1073
1104
|
var qParams = typeof queryParams === 'string'
|
|
1074
1105
|
? { fromString: queryParams }
|
|
1075
1106
|
: { fromObject: queryParams };
|
|
1076
|
-
var params = new
|
|
1107
|
+
var params = new i1.HttpParams(qParams);
|
|
1077
1108
|
return this.execute('GET', this.entitiesUrl, undefined, { params: params });
|
|
1078
1109
|
};
|
|
1079
1110
|
DefaultDataService.prototype.update = function (update) {
|
|
@@ -1127,7 +1158,7 @@
|
|
|
1127
1158
|
}
|
|
1128
1159
|
default: {
|
|
1129
1160
|
var error = new Error('Unimplemented HTTP method, ' + method);
|
|
1130
|
-
result$ =
|
|
1161
|
+
result$ = i4.throwError(error);
|
|
1131
1162
|
}
|
|
1132
1163
|
}
|
|
1133
1164
|
if (this.timeout) {
|
|
@@ -1143,14 +1174,14 @@
|
|
|
1143
1174
|
return ok;
|
|
1144
1175
|
}
|
|
1145
1176
|
var error = new DataServiceError(err, reqData);
|
|
1146
|
-
return
|
|
1177
|
+
return i4.throwError(error);
|
|
1147
1178
|
};
|
|
1148
1179
|
};
|
|
1149
1180
|
DefaultDataService.prototype.handleDelete404 = function (error, reqData) {
|
|
1150
1181
|
if (error.status === 404 &&
|
|
1151
1182
|
reqData.method === 'DELETE' &&
|
|
1152
1183
|
this.delete404OK) {
|
|
1153
|
-
return
|
|
1184
|
+
return i4.of({});
|
|
1154
1185
|
}
|
|
1155
1186
|
return undefined;
|
|
1156
1187
|
};
|
|
@@ -1178,15 +1209,15 @@
|
|
|
1178
1209
|
};
|
|
1179
1210
|
return DefaultDataServiceFactory;
|
|
1180
1211
|
}());
|
|
1181
|
-
DefaultDataServiceFactory
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1212
|
+
/** @nocollapse */ DefaultDataServiceFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultDataServiceFactory, deps: [{ token: i1__namespace.HttpClient }, { token: HttpUrlGenerator }, { token: DefaultDataServiceConfig, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1213
|
+
/** @nocollapse */ DefaultDataServiceFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultDataServiceFactory });
|
|
1214
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultDataServiceFactory, decorators: [{
|
|
1215
|
+
type: i0.Injectable
|
|
1216
|
+
}], ctorParameters: function () {
|
|
1217
|
+
return [{ type: i1__namespace.HttpClient }, { type: HttpUrlGenerator }, { type: DefaultDataServiceConfig, decorators: [{
|
|
1218
|
+
type: i0.Optional
|
|
1219
|
+
}] }];
|
|
1220
|
+
} });
|
|
1190
1221
|
|
|
1191
1222
|
function createEntityDefinition(metadata) {
|
|
1192
1223
|
var entityName = metadata.entityName;
|
|
@@ -1212,7 +1243,7 @@
|
|
|
1212
1243
|
};
|
|
1213
1244
|
}
|
|
1214
1245
|
|
|
1215
|
-
var ENTITY_METADATA_TOKEN = new
|
|
1246
|
+
var ENTITY_METADATA_TOKEN = new i0.InjectionToken('@ngrx/data Entity Metadata');
|
|
1216
1247
|
|
|
1217
1248
|
/** Registry of EntityDefinitions for all cached entity types */
|
|
1218
1249
|
var EntityDefinitionService = /** @class */ (function () {
|
|
@@ -1297,13 +1328,18 @@
|
|
|
1297
1328
|
};
|
|
1298
1329
|
return EntityDefinitionService;
|
|
1299
1330
|
}());
|
|
1300
|
-
EntityDefinitionService
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1331
|
+
/** @nocollapse */ EntityDefinitionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDefinitionService, deps: [{ token: ENTITY_METADATA_TOKEN, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1332
|
+
/** @nocollapse */ EntityDefinitionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDefinitionService });
|
|
1333
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDefinitionService, decorators: [{
|
|
1334
|
+
type: i0.Injectable
|
|
1335
|
+
}], ctorParameters: function () {
|
|
1336
|
+
return [{ type: undefined, decorators: [{
|
|
1337
|
+
type: i0.Optional
|
|
1338
|
+
}, {
|
|
1339
|
+
type: i0.Inject,
|
|
1340
|
+
args: [ENTITY_METADATA_TOKEN]
|
|
1341
|
+
}] }];
|
|
1342
|
+
} });
|
|
1307
1343
|
|
|
1308
1344
|
var updateOp = exports.ChangeSetOperation.Update;
|
|
1309
1345
|
/**
|
|
@@ -1353,7 +1389,7 @@
|
|
|
1353
1389
|
EntityCacheDataService.prototype.handleError = function (reqData) {
|
|
1354
1390
|
return function (err) {
|
|
1355
1391
|
var error = new DataServiceError(err, reqData);
|
|
1356
|
-
return
|
|
1392
|
+
return i4.throwError(error);
|
|
1357
1393
|
};
|
|
1358
1394
|
};
|
|
1359
1395
|
/**
|
|
@@ -1431,15 +1467,15 @@
|
|
|
1431
1467
|
};
|
|
1432
1468
|
return EntityCacheDataService;
|
|
1433
1469
|
}());
|
|
1434
|
-
EntityCacheDataService
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1470
|
+
/** @nocollapse */ EntityCacheDataService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDataService, deps: [{ token: EntityDefinitionService }, { token: i1__namespace.HttpClient }, { token: DefaultDataServiceConfig, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1471
|
+
/** @nocollapse */ EntityCacheDataService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDataService });
|
|
1472
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDataService, decorators: [{
|
|
1473
|
+
type: i0.Injectable
|
|
1474
|
+
}], ctorParameters: function () {
|
|
1475
|
+
return [{ type: EntityDefinitionService }, { type: i1__namespace.HttpClient }, { type: DefaultDataServiceConfig, decorators: [{
|
|
1476
|
+
type: i0.Optional
|
|
1477
|
+
}] }];
|
|
1478
|
+
} });
|
|
1443
1479
|
|
|
1444
1480
|
/**
|
|
1445
1481
|
* Registry of EntityCollection data services that make REST-like CRUD calls
|
|
@@ -1496,13 +1532,11 @@
|
|
|
1496
1532
|
};
|
|
1497
1533
|
return EntityDataService;
|
|
1498
1534
|
}());
|
|
1499
|
-
EntityDataService
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
{ type: DefaultDataServiceFactory }
|
|
1505
|
-
]; };
|
|
1535
|
+
/** @nocollapse */ EntityDataService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataService, deps: [{ token: DefaultDataServiceFactory }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1536
|
+
/** @nocollapse */ EntityDataService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataService });
|
|
1537
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataService, decorators: [{
|
|
1538
|
+
type: i0.Injectable
|
|
1539
|
+
}], ctorParameters: function () { return [{ type: DefaultDataServiceFactory }]; } });
|
|
1506
1540
|
|
|
1507
1541
|
/**
|
|
1508
1542
|
* Handling of responses from persistence operation
|
|
@@ -1547,14 +1581,22 @@
|
|
|
1547
1581
|
};
|
|
1548
1582
|
return DefaultPersistenceResultHandler;
|
|
1549
1583
|
}());
|
|
1550
|
-
DefaultPersistenceResultHandler
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1584
|
+
/** @nocollapse */ DefaultPersistenceResultHandler.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPersistenceResultHandler, deps: [{ token: Logger }, { token: EntityActionFactory }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1585
|
+
/** @nocollapse */ DefaultPersistenceResultHandler.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPersistenceResultHandler });
|
|
1586
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPersistenceResultHandler, decorators: [{
|
|
1587
|
+
type: i0.Injectable
|
|
1588
|
+
}], ctorParameters: function () { return [{ type: Logger }, { type: EntityActionFactory }]; } });
|
|
1589
|
+
|
|
1590
|
+
/**
|
|
1591
|
+
* Persistence operation canceled
|
|
1592
|
+
*/
|
|
1593
|
+
var PersistanceCanceled = /** @class */ (function () {
|
|
1594
|
+
function PersistanceCanceled(message) {
|
|
1595
|
+
this.message = message;
|
|
1596
|
+
this.message = message || 'Canceled by user';
|
|
1597
|
+
}
|
|
1598
|
+
return PersistanceCanceled;
|
|
1599
|
+
}());
|
|
1558
1600
|
|
|
1559
1601
|
/**
|
|
1560
1602
|
* Generates a string id beginning 'CRID',
|
|
@@ -1579,9 +1621,11 @@
|
|
|
1579
1621
|
};
|
|
1580
1622
|
return CorrelationIdGenerator;
|
|
1581
1623
|
}());
|
|
1582
|
-
CorrelationIdGenerator
|
|
1583
|
-
|
|
1584
|
-
|
|
1624
|
+
/** @nocollapse */ CorrelationIdGenerator.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: CorrelationIdGenerator, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1625
|
+
/** @nocollapse */ CorrelationIdGenerator.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: CorrelationIdGenerator });
|
|
1626
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: CorrelationIdGenerator, decorators: [{
|
|
1627
|
+
type: i0.Injectable
|
|
1628
|
+
}] });
|
|
1585
1629
|
|
|
1586
1630
|
/**
|
|
1587
1631
|
* Default options for EntityDispatcher behavior
|
|
@@ -1606,20 +1650,11 @@
|
|
|
1606
1650
|
}
|
|
1607
1651
|
return EntityDispatcherDefaultOptions;
|
|
1608
1652
|
}());
|
|
1609
|
-
EntityDispatcherDefaultOptions
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
* Persistence operation canceled
|
|
1615
|
-
*/
|
|
1616
|
-
var PersistanceCanceled = /** @class */ (function () {
|
|
1617
|
-
function PersistanceCanceled(message) {
|
|
1618
|
-
this.message = message;
|
|
1619
|
-
this.message = message || 'Canceled by user';
|
|
1620
|
-
}
|
|
1621
|
-
return PersistanceCanceled;
|
|
1622
|
-
}());
|
|
1653
|
+
/** @nocollapse */ EntityDispatcherDefaultOptions.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherDefaultOptions, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1654
|
+
/** @nocollapse */ EntityDispatcherDefaultOptions.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherDefaultOptions });
|
|
1655
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherDefaultOptions, decorators: [{
|
|
1656
|
+
type: i0.Injectable
|
|
1657
|
+
}] });
|
|
1623
1658
|
|
|
1624
1659
|
/**
|
|
1625
1660
|
* Dispatches Entity Cache actions to the EntityCache reducer
|
|
@@ -1757,24 +1792,24 @@
|
|
|
1757
1792
|
act.type === exports.EntityCacheAction.SAVE_ENTITIES_ERROR ||
|
|
1758
1793
|
act.type === exports.EntityCacheAction.SAVE_ENTITIES_CANCEL; }), operators.filter(function (act) { return crid === act.payload.correlationId; }), operators.take(1), operators.mergeMap(function (act) {
|
|
1759
1794
|
return act.type === exports.EntityCacheAction.SAVE_ENTITIES_CANCEL
|
|
1760
|
-
?
|
|
1795
|
+
? i4.throwError(new PersistanceCanceled(act.payload.reason))
|
|
1761
1796
|
: act.type === exports.EntityCacheAction.SAVE_ENTITIES_SUCCESS
|
|
1762
|
-
?
|
|
1763
|
-
:
|
|
1797
|
+
? i4.of(act.payload.changeSet)
|
|
1798
|
+
: i4.throwError(act.payload);
|
|
1764
1799
|
}));
|
|
1765
1800
|
};
|
|
1766
1801
|
return EntityCacheDispatcher;
|
|
1767
1802
|
}());
|
|
1768
|
-
EntityCacheDispatcher
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1803
|
+
/** @nocollapse */ EntityCacheDispatcher.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDispatcher, deps: [{ token: CorrelationIdGenerator }, { token: EntityDispatcherDefaultOptions }, { token: i1$1.ScannedActionsSubject }, { token: i1__namespace$1.Store }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1804
|
+
/** @nocollapse */ EntityCacheDispatcher.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDispatcher });
|
|
1805
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheDispatcher, decorators: [{
|
|
1806
|
+
type: i0.Injectable
|
|
1807
|
+
}], ctorParameters: function () {
|
|
1808
|
+
return [{ type: CorrelationIdGenerator }, { type: EntityDispatcherDefaultOptions }, { type: i4__namespace.Observable, decorators: [{
|
|
1809
|
+
type: i0.Inject,
|
|
1810
|
+
args: [i1$1.ScannedActionsSubject]
|
|
1811
|
+
}] }, { type: i1__namespace$1.Store }];
|
|
1812
|
+
} });
|
|
1778
1813
|
|
|
1779
1814
|
/**
|
|
1780
1815
|
* Dispatches EntityCollection actions to their reducers and effects (default implementation).
|
|
@@ -1787,7 +1822,7 @@
|
|
|
1787
1822
|
/** Creates an {EntityAction} */
|
|
1788
1823
|
entityActionFactory,
|
|
1789
1824
|
/** The store, scoped to the EntityCache */
|
|
1790
|
-
store
|
|
1825
|
+
store,
|
|
1791
1826
|
/** Returns the primary key (id) of this entity */
|
|
1792
1827
|
selectId,
|
|
1793
1828
|
/**
|
|
@@ -1804,15 +1839,15 @@
|
|
|
1804
1839
|
if (selectId === void 0) { selectId = defaultSelectId; }
|
|
1805
1840
|
this.entityName = entityName;
|
|
1806
1841
|
this.entityActionFactory = entityActionFactory;
|
|
1807
|
-
this.store = store
|
|
1842
|
+
this.store = store;
|
|
1808
1843
|
this.selectId = selectId;
|
|
1809
1844
|
this.defaultDispatcherOptions = defaultDispatcherOptions;
|
|
1810
1845
|
this.reducedActions$ = reducedActions$;
|
|
1811
1846
|
this.correlationIdGenerator = correlationIdGenerator;
|
|
1812
1847
|
this.guard = new EntityActionGuard(entityName, selectId);
|
|
1813
1848
|
this.toUpdate = toUpdateFactory(selectId);
|
|
1814
|
-
var collectionSelector =
|
|
1815
|
-
this.entityCollection$ = store
|
|
1849
|
+
var collectionSelector = i1$1.createSelector(entityCacheSelector, function (cache) { return cache[entityName]; });
|
|
1850
|
+
this.entityCollection$ = store.select(collectionSelector);
|
|
1816
1851
|
}
|
|
1817
1852
|
/**
|
|
1818
1853
|
* Create an {EntityAction} for this entity type.
|
|
@@ -1822,8 +1857,7 @@
|
|
|
1822
1857
|
* @returns the EntityAction
|
|
1823
1858
|
*/
|
|
1824
1859
|
EntityDispatcherBase.prototype.createEntityAction = function (entityOp, data, options) {
|
|
1825
|
-
return this.entityActionFactory.create(Object.assign({ entityName: this.entityName, entityOp: entityOp,
|
|
1826
|
-
data: data }, options));
|
|
1860
|
+
return this.entityActionFactory.create(Object.assign({ entityName: this.entityName, entityOp: entityOp, data: data }, options));
|
|
1827
1861
|
};
|
|
1828
1862
|
/**
|
|
1829
1863
|
* Create an {EntityAction} for this entity type and
|
|
@@ -2173,10 +2207,10 @@
|
|
|
2173
2207
|
}), operators.take(1), operators.mergeMap(function (act) {
|
|
2174
2208
|
var entityOp = act.payload.entityOp;
|
|
2175
2209
|
return entityOp === exports.EntityOp.CANCEL_PERSIST
|
|
2176
|
-
?
|
|
2210
|
+
? i4.throwError(new PersistanceCanceled(act.payload.data))
|
|
2177
2211
|
: entityOp.endsWith(OP_SUCCESS)
|
|
2178
|
-
?
|
|
2179
|
-
:
|
|
2212
|
+
? i4.of(act.payload.data)
|
|
2213
|
+
: i4.throwError(act.payload.data.error);
|
|
2180
2214
|
}));
|
|
2181
2215
|
};
|
|
2182
2216
|
EntityDispatcherBase.prototype.setQueryEntityActionOptions = function (options) {
|
|
@@ -2200,20 +2234,20 @@
|
|
|
2200
2234
|
}());
|
|
2201
2235
|
|
|
2202
2236
|
var ENTITY_CACHE_NAME = 'entityCache';
|
|
2203
|
-
var ENTITY_CACHE_NAME_TOKEN = new
|
|
2204
|
-
var ENTITY_CACHE_META_REDUCERS = new
|
|
2205
|
-
var ENTITY_COLLECTION_META_REDUCERS = new
|
|
2206
|
-
var INITIAL_ENTITY_CACHE_STATE = new
|
|
2237
|
+
var ENTITY_CACHE_NAME_TOKEN = new i0.InjectionToken('@ngrx/data Entity Cache Name');
|
|
2238
|
+
var ENTITY_CACHE_META_REDUCERS = new i0.InjectionToken('@ngrx/data Entity Cache Meta Reducers');
|
|
2239
|
+
var ENTITY_COLLECTION_META_REDUCERS = new i0.InjectionToken('@ngrx/data Entity Collection Meta Reducers');
|
|
2240
|
+
var INITIAL_ENTITY_CACHE_STATE = new i0.InjectionToken('@ngrx/data Initial Entity Cache State');
|
|
2207
2241
|
|
|
2208
|
-
var ENTITY_CACHE_SELECTOR_TOKEN = new
|
|
2242
|
+
var ENTITY_CACHE_SELECTOR_TOKEN = new i0.InjectionToken('@ngrx/data Entity Cache Selector');
|
|
2209
2243
|
var entityCacheSelectorProvider = {
|
|
2210
2244
|
provide: ENTITY_CACHE_SELECTOR_TOKEN,
|
|
2211
2245
|
useFactory: createEntityCacheSelector,
|
|
2212
|
-
deps: [[new
|
|
2246
|
+
deps: [[new i0.Optional(), ENTITY_CACHE_NAME_TOKEN]],
|
|
2213
2247
|
};
|
|
2214
2248
|
function createEntityCacheSelector(entityCacheName) {
|
|
2215
2249
|
entityCacheName = entityCacheName || ENTITY_CACHE_NAME;
|
|
2216
|
-
return
|
|
2250
|
+
return i1$1.createFeatureSelector(entityCacheName);
|
|
2217
2251
|
}
|
|
2218
2252
|
|
|
2219
2253
|
/** Creates EntityDispatchers for entity collections */
|
|
@@ -2257,22 +2291,23 @@
|
|
|
2257
2291
|
};
|
|
2258
2292
|
return EntityDispatcherFactory;
|
|
2259
2293
|
}());
|
|
2260
|
-
EntityDispatcherFactory
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2294
|
+
/** @nocollapse */ EntityDispatcherFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherFactory, deps: [{ token: EntityActionFactory }, { token: i1__namespace$1.Store }, { token: EntityDispatcherDefaultOptions }, { token: i1$1.ScannedActionsSubject }, { token: ENTITY_CACHE_SELECTOR_TOKEN }, { token: CorrelationIdGenerator }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2295
|
+
/** @nocollapse */ EntityDispatcherFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherFactory });
|
|
2296
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDispatcherFactory, decorators: [{
|
|
2297
|
+
type: i0.Injectable
|
|
2298
|
+
}], ctorParameters: function () {
|
|
2299
|
+
return [{ type: EntityActionFactory }, { type: i1__namespace$1.Store }, { type: EntityDispatcherDefaultOptions }, { type: i4__namespace.Observable, decorators: [{
|
|
2300
|
+
type: i0.Inject,
|
|
2301
|
+
args: [i1$1.ScannedActionsSubject]
|
|
2302
|
+
}] }, { type: undefined, decorators: [{
|
|
2303
|
+
type: i0.Inject,
|
|
2304
|
+
args: [ENTITY_CACHE_SELECTOR_TOKEN]
|
|
2305
|
+
}] }, { type: CorrelationIdGenerator }];
|
|
2306
|
+
} });
|
|
2272
2307
|
|
|
2273
2308
|
// See https://github.com/ReactiveX/rxjs/blob/master/doc/marble-testing.md
|
|
2274
2309
|
/** Token to inject a special RxJS Scheduler during marble tests. */
|
|
2275
|
-
var ENTITY_EFFECTS_SCHEDULER = new
|
|
2310
|
+
var ENTITY_EFFECTS_SCHEDULER = new i0.InjectionToken('@ngrx/data Entity Effects Scheduler');
|
|
2276
2311
|
|
|
2277
2312
|
var EntityCacheEffects = /** @class */ (function () {
|
|
2278
2313
|
function EntityCacheEffects(actions, dataService, entityActionFactory, logger,
|
|
@@ -2294,10 +2329,10 @@
|
|
|
2294
2329
|
/**
|
|
2295
2330
|
* Observable of SAVE_ENTITIES_CANCEL actions with non-null correlation ids
|
|
2296
2331
|
*/
|
|
2297
|
-
this.saveEntitiesCancel$ =
|
|
2332
|
+
this.saveEntitiesCancel$ = i1$2.createEffect(function () { return _this.actions.pipe(i1$2.ofType(exports.EntityCacheAction.SAVE_ENTITIES_CANCEL), operators.filter(function (a) { return a.payload.correlationId != null; })); }, { dispatch: false });
|
|
2298
2333
|
// Concurrent persistence requests considered unsafe.
|
|
2299
2334
|
// `mergeMap` allows for concurrent requests which may return in any order
|
|
2300
|
-
this.saveEntities$ =
|
|
2335
|
+
this.saveEntities$ = i1$2.createEffect(function () { return _this.actions.pipe(i1$2.ofType(exports.EntityCacheAction.SAVE_ENTITIES), operators.mergeMap(function (action) { return _this.saveEntities(action); })); });
|
|
2301
2336
|
}
|
|
2302
2337
|
/**
|
|
2303
2338
|
* Perform the requested SaveEntities actions and return a scalar Observable<Action>
|
|
@@ -2316,7 +2351,7 @@
|
|
|
2316
2351
|
var options = { correlationId: correlationId_1, mergeStrategy: mergeStrategy, tag: tag };
|
|
2317
2352
|
if (changeSet.changes.length === 0) {
|
|
2318
2353
|
// nothing to save
|
|
2319
|
-
return
|
|
2354
|
+
return i4.of(new SaveEntitiesSuccess(changeSet, url, options));
|
|
2320
2355
|
}
|
|
2321
2356
|
// Cancellation: returns Observable<SaveEntitiesCanceled> for a saveEntities action
|
|
2322
2357
|
// whose correlationId matches the cancellation correlationId
|
|
@@ -2324,7 +2359,7 @@
|
|
|
2324
2359
|
// Data: SaveEntities result as a SaveEntitiesSuccess action
|
|
2325
2360
|
var d = this.dataService.saveEntities(changeSet, url).pipe(operators.concatMap(function (result) { return _this.handleSaveEntitiesSuccess$(action, _this.entityActionFactory)(result); }), operators.catchError(this.handleSaveEntitiesError$(action)));
|
|
2326
2361
|
// Emit which ever gets there first; the other observable is terminated.
|
|
2327
|
-
return
|
|
2362
|
+
return i4.race(c, d);
|
|
2328
2363
|
}
|
|
2329
2364
|
catch (err) {
|
|
2330
2365
|
return this.handleSaveEntitiesError$(action)(err);
|
|
@@ -2338,7 +2373,7 @@
|
|
|
2338
2373
|
// as app likely assumes asynchronous response.
|
|
2339
2374
|
return function (err) {
|
|
2340
2375
|
var error = err instanceof DataServiceError ? err : new DataServiceError(err, null);
|
|
2341
|
-
return
|
|
2376
|
+
return i4.of(new SaveEntitiesError(error, action)).pipe(operators.delay(_this.responseDelay, _this.scheduler || i4.asyncScheduler));
|
|
2342
2377
|
};
|
|
2343
2378
|
};
|
|
2344
2379
|
/** return handler of the ChangeSet result of successful saveEntities() */
|
|
@@ -2348,7 +2383,7 @@
|
|
|
2348
2383
|
return function (changeSet) {
|
|
2349
2384
|
// DataService returned a ChangeSet with possible updates to the saved entities
|
|
2350
2385
|
if (changeSet) {
|
|
2351
|
-
return
|
|
2386
|
+
return i4.of(new SaveEntitiesSuccess(changeSet, url, options));
|
|
2352
2387
|
}
|
|
2353
2388
|
// No ChangeSet = Server probably responded '204 - No Content' because
|
|
2354
2389
|
// it made no changes to the inserted/updated entities.
|
|
@@ -2356,29 +2391,30 @@
|
|
|
2356
2391
|
changeSet = action.payload.changeSet;
|
|
2357
2392
|
// If pessimistic save, return success action with the original ChangeSet
|
|
2358
2393
|
if (!action.payload.isOptimistic) {
|
|
2359
|
-
return
|
|
2394
|
+
return i4.of(new SaveEntitiesSuccess(changeSet, url, options));
|
|
2360
2395
|
}
|
|
2361
2396
|
// If optimistic save, avoid cache grinding by just turning off the loading flags
|
|
2362
2397
|
// for all collections in the original ChangeSet
|
|
2363
2398
|
var entityNames = changeSet.changes.reduce(function (acc, item) { return acc.indexOf(item.entityName) === -1
|
|
2364
2399
|
? acc.concat(item.entityName)
|
|
2365
2400
|
: acc; }, []);
|
|
2366
|
-
return
|
|
2401
|
+
return i4.merge(entityNames.map(function (name) { return entityActionFactory.create(name, exports.EntityOp.SET_LOADING, false); }));
|
|
2367
2402
|
};
|
|
2368
2403
|
};
|
|
2369
2404
|
return EntityCacheEffects;
|
|
2370
2405
|
}());
|
|
2371
|
-
EntityCacheEffects
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2406
|
+
/** @nocollapse */ EntityCacheEffects.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheEffects, deps: [{ token: i1__namespace$2.Actions }, { token: EntityCacheDataService }, { token: EntityActionFactory }, { token: Logger }, { token: ENTITY_EFFECTS_SCHEDULER, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2407
|
+
/** @nocollapse */ EntityCacheEffects.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheEffects });
|
|
2408
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheEffects, decorators: [{
|
|
2409
|
+
type: i0.Injectable
|
|
2410
|
+
}], ctorParameters: function () {
|
|
2411
|
+
return [{ type: i1__namespace$2.Actions }, { type: EntityCacheDataService }, { type: EntityActionFactory }, { type: Logger }, { type: undefined, decorators: [{
|
|
2412
|
+
type: i0.Optional
|
|
2413
|
+
}, {
|
|
2414
|
+
type: i0.Inject,
|
|
2415
|
+
args: [ENTITY_EFFECTS_SCHEDULER]
|
|
2416
|
+
}] }];
|
|
2417
|
+
} });
|
|
2382
2418
|
|
|
2383
2419
|
var persistOps = [
|
|
2384
2420
|
exports.EntityOp.QUERY_ALL,
|
|
@@ -2410,9 +2446,9 @@
|
|
|
2410
2446
|
/**
|
|
2411
2447
|
* Observable of non-null cancellation correlation ids from CANCEL_PERSIST actions
|
|
2412
2448
|
*/
|
|
2413
|
-
this.cancel$ =
|
|
2449
|
+
this.cancel$ = i1$2.createEffect(function () { return _this.actions.pipe(ofEntityOp(exports.EntityOp.CANCEL_PERSIST), operators.map(function (action) { return action.payload.correlationId; }), operators.filter(function (id) { return id != null; })); }, { dispatch: false });
|
|
2414
2450
|
// `mergeMap` allows for concurrent requests which may return in any order
|
|
2415
|
-
this.persist$ =
|
|
2451
|
+
this.persist$ = i1$2.createEffect(function () { return _this.actions.pipe(ofEntityOp(persistOps), operators.mergeMap(function (action) { return _this.persist(action); })); });
|
|
2416
2452
|
}
|
|
2417
2453
|
/**
|
|
2418
2454
|
* Perform the requested persistence operation and return a scalar Observable<Action>
|
|
@@ -2437,7 +2473,7 @@
|
|
|
2437
2473
|
// Data: entity collection DataService result as a successful persistence EntityAction
|
|
2438
2474
|
var d = this.callDataService(action).pipe(operators.map(this.resultHandler.handleSuccess(action)), operators.catchError(this.handleError$(action)));
|
|
2439
2475
|
// Emit which ever gets there first; the other observable is terminated.
|
|
2440
|
-
return
|
|
2476
|
+
return i4.race(c, d);
|
|
2441
2477
|
}
|
|
2442
2478
|
catch (err) {
|
|
2443
2479
|
return this.handleError$(action)(err);
|
|
@@ -2491,7 +2527,7 @@
|
|
|
2491
2527
|
// Although error may return immediately,
|
|
2492
2528
|
// ensure observable takes some time,
|
|
2493
2529
|
// as app likely assumes asynchronous response.
|
|
2494
|
-
return function (error) { return
|
|
2530
|
+
return function (error) { return i4.of(_this.resultHandler.handleError(action)(error)).pipe(operators.delay(_this.responseDelay, _this.scheduler || i4.asyncScheduler)); };
|
|
2495
2531
|
};
|
|
2496
2532
|
/**
|
|
2497
2533
|
* Because EntityAction.payload.skip is true, skip the persistence step and
|
|
@@ -2505,21 +2541,22 @@
|
|
|
2505
2541
|
// Although returns immediately,
|
|
2506
2542
|
// ensure observable takes one tick (by using a promise),
|
|
2507
2543
|
// as app likely assumes asynchronous response.
|
|
2508
|
-
return
|
|
2544
|
+
return i4.of(successAction).pipe(operators.delay(this.responseDelay, this.scheduler || i4.asyncScheduler));
|
|
2509
2545
|
};
|
|
2510
2546
|
return EntityEffects;
|
|
2511
2547
|
}());
|
|
2512
|
-
EntityEffects
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2548
|
+
/** @nocollapse */ EntityEffects.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityEffects, deps: [{ token: i1__namespace$2.Actions }, { token: EntityDataService }, { token: EntityActionFactory }, { token: PersistenceResultHandler }, { token: ENTITY_EFFECTS_SCHEDULER, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2549
|
+
/** @nocollapse */ EntityEffects.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityEffects });
|
|
2550
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityEffects, decorators: [{
|
|
2551
|
+
type: i0.Injectable
|
|
2552
|
+
}], ctorParameters: function () {
|
|
2553
|
+
return [{ type: i1__namespace$2.Actions }, { type: EntityDataService }, { type: EntityActionFactory }, { type: PersistenceResultHandler }, { type: undefined, decorators: [{
|
|
2554
|
+
type: i0.Optional
|
|
2555
|
+
}, {
|
|
2556
|
+
type: i0.Inject,
|
|
2557
|
+
args: [ENTITY_EFFECTS_SCHEDULER]
|
|
2558
|
+
}] }];
|
|
2559
|
+
} });
|
|
2523
2560
|
|
|
2524
2561
|
/**
|
|
2525
2562
|
* Creates an {EntityFilterFn} that matches RegExp or RegExp string pattern
|
|
@@ -2826,13 +2863,15 @@
|
|
|
2826
2863
|
};
|
|
2827
2864
|
return EntityCollectionCreator;
|
|
2828
2865
|
}());
|
|
2829
|
-
EntityCollectionCreator
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2866
|
+
/** @nocollapse */ EntityCollectionCreator.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionCreator, deps: [{ token: EntityDefinitionService, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2867
|
+
/** @nocollapse */ EntityCollectionCreator.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionCreator });
|
|
2868
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionCreator, decorators: [{
|
|
2869
|
+
type: i0.Injectable
|
|
2870
|
+
}], ctorParameters: function () {
|
|
2871
|
+
return [{ type: EntityDefinitionService, decorators: [{
|
|
2872
|
+
type: i0.Optional
|
|
2873
|
+
}] }];
|
|
2874
|
+
} });
|
|
2836
2875
|
function createEmptyEntityCollection(entityName) {
|
|
2837
2876
|
return {
|
|
2838
2877
|
entityName: entityName,
|
|
@@ -2865,7 +2904,7 @@
|
|
|
2865
2904
|
return ((cache[entityName] ||
|
|
2866
2905
|
_this.entityCollectionCreator.create(entityName)));
|
|
2867
2906
|
};
|
|
2868
|
-
return
|
|
2907
|
+
return i1$1.createSelector(this.selectEntityCache, getCollection);
|
|
2869
2908
|
};
|
|
2870
2909
|
// createCollectionSelectors implementation
|
|
2871
2910
|
EntitySelectorsFactory.prototype.createCollectionSelectors = function (metadataOrName) {
|
|
@@ -2874,13 +2913,13 @@
|
|
|
2874
2913
|
: metadataOrName;
|
|
2875
2914
|
var selectKeys = function (c) { return c.ids; };
|
|
2876
2915
|
var selectEntityMap = function (c) { return c.entities; };
|
|
2877
|
-
var selectEntities =
|
|
2878
|
-
var selectCount =
|
|
2916
|
+
var selectEntities = i1$1.createSelector(selectKeys, selectEntityMap, function (keys, entities) { return keys.map(function (key) { return entities[key]; }); });
|
|
2917
|
+
var selectCount = i1$1.createSelector(selectKeys, function (keys) { return keys.length; });
|
|
2879
2918
|
// EntityCollection selectors that go beyond the ngrx/entity/EntityState selectors
|
|
2880
2919
|
var selectFilter = function (c) { return c.filter; };
|
|
2881
2920
|
var filterFn = metadata.filterFn;
|
|
2882
2921
|
var selectFilteredEntities = filterFn
|
|
2883
|
-
?
|
|
2922
|
+
? i1$1.createSelector(selectEntities, selectFilter, function (entities, pattern) { return filterFn(entities, pattern); })
|
|
2884
2923
|
: selectEntities;
|
|
2885
2924
|
var selectLoaded = function (c) { return c.loaded; };
|
|
2886
2925
|
var selectLoading = function (c) { return c.loading; };
|
|
@@ -2892,15 +2931,7 @@
|
|
|
2892
2931
|
Object.keys(extra).forEach(function (k) {
|
|
2893
2932
|
extraSelectors['select' + k[0].toUpperCase() + k.slice(1)] = function (c) { return c[k]; };
|
|
2894
2933
|
});
|
|
2895
|
-
return Object.assign({ selectCount: selectCount,
|
|
2896
|
-
selectEntities: selectEntities,
|
|
2897
|
-
selectEntityMap: selectEntityMap,
|
|
2898
|
-
selectFilter: selectFilter,
|
|
2899
|
-
selectFilteredEntities: selectFilteredEntities,
|
|
2900
|
-
selectKeys: selectKeys,
|
|
2901
|
-
selectLoaded: selectLoaded,
|
|
2902
|
-
selectLoading: selectLoading,
|
|
2903
|
-
selectChangeState: selectChangeState }, extraSelectors);
|
|
2934
|
+
return Object.assign({ selectCount: selectCount, selectEntities: selectEntities, selectEntityMap: selectEntityMap, selectFilter: selectFilter, selectFilteredEntities: selectFilteredEntities, selectKeys: selectKeys, selectLoaded: selectLoaded, selectLoading: selectLoading, selectChangeState: selectChangeState }, extraSelectors);
|
|
2904
2935
|
};
|
|
2905
2936
|
// createCollectionSelectors implementation
|
|
2906
2937
|
EntitySelectorsFactory.prototype.create = function (metadataOrName) {
|
|
@@ -2912,21 +2943,26 @@
|
|
|
2912
2943
|
var collectionSelectors = this.createCollectionSelectors(metadata);
|
|
2913
2944
|
var entitySelectors = {};
|
|
2914
2945
|
Object.keys(collectionSelectors).forEach(function (k) {
|
|
2915
|
-
entitySelectors[k] =
|
|
2946
|
+
entitySelectors[k] = i1$1.createSelector(selectCollection, collectionSelectors[k]);
|
|
2916
2947
|
});
|
|
2917
|
-
return Object.assign({ entityName: entityName,
|
|
2918
|
-
selectCollection: selectCollection, selectEntityCache: this.selectEntityCache }, entitySelectors);
|
|
2948
|
+
return Object.assign({ entityName: entityName, selectCollection: selectCollection, selectEntityCache: this.selectEntityCache }, entitySelectors);
|
|
2919
2949
|
};
|
|
2920
2950
|
return EntitySelectorsFactory;
|
|
2921
2951
|
}());
|
|
2922
|
-
EntitySelectorsFactory
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2952
|
+
/** @nocollapse */ EntitySelectorsFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectorsFactory, deps: [{ token: EntityCollectionCreator, optional: true }, { token: ENTITY_CACHE_SELECTOR_TOKEN, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
2953
|
+
/** @nocollapse */ EntitySelectorsFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectorsFactory });
|
|
2954
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectorsFactory, decorators: [{
|
|
2955
|
+
type: i0.Injectable
|
|
2956
|
+
}], ctorParameters: function () {
|
|
2957
|
+
return [{ type: EntityCollectionCreator, decorators: [{
|
|
2958
|
+
type: i0.Optional
|
|
2959
|
+
}] }, { type: undefined, decorators: [{
|
|
2960
|
+
type: i0.Optional
|
|
2961
|
+
}, {
|
|
2962
|
+
type: i0.Inject,
|
|
2963
|
+
args: [ENTITY_CACHE_SELECTOR_TOKEN]
|
|
2964
|
+
}] }];
|
|
2965
|
+
} });
|
|
2930
2966
|
|
|
2931
2967
|
/** Creates observable EntitySelectors$ for entity collections. */
|
|
2932
2968
|
var EntitySelectors$Factory = /** @class */ (function () {
|
|
@@ -2965,15 +3001,16 @@
|
|
|
2965
3001
|
};
|
|
2966
3002
|
return EntitySelectors$Factory;
|
|
2967
3003
|
}());
|
|
2968
|
-
EntitySelectors$Factory
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3004
|
+
/** @nocollapse */ EntitySelectors$Factory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectors$Factory, deps: [{ token: i1__namespace$1.Store }, { token: i1__namespace$2.Actions }, { token: ENTITY_CACHE_SELECTOR_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3005
|
+
/** @nocollapse */ EntitySelectors$Factory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectors$Factory });
|
|
3006
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntitySelectors$Factory, decorators: [{
|
|
3007
|
+
type: i0.Injectable
|
|
3008
|
+
}], ctorParameters: function () {
|
|
3009
|
+
return [{ type: i1__namespace$1.Store }, { type: i1__namespace$2.Actions }, { type: undefined, decorators: [{
|
|
3010
|
+
type: i0.Inject,
|
|
3011
|
+
args: [ENTITY_CACHE_SELECTOR_TOKEN]
|
|
3012
|
+
}] }];
|
|
3013
|
+
} });
|
|
2977
3014
|
|
|
2978
3015
|
/** Creates the core elements of the EntityCollectionService for an entity type. */
|
|
2979
3016
|
var EntityCollectionServiceElementsFactory = /** @class */ (function () {
|
|
@@ -3002,16 +3039,11 @@
|
|
|
3002
3039
|
};
|
|
3003
3040
|
return EntityCollectionServiceElementsFactory;
|
|
3004
3041
|
}());
|
|
3005
|
-
EntityCollectionServiceElementsFactory
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
{ type: EntityDispatcherFactory },
|
|
3011
|
-
{ type: EntityDefinitionService },
|
|
3012
|
-
{ type: EntitySelectorsFactory },
|
|
3013
|
-
{ type: EntitySelectors$Factory }
|
|
3014
|
-
]; };
|
|
3042
|
+
/** @nocollapse */ EntityCollectionServiceElementsFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceElementsFactory, deps: [{ token: EntityDispatcherFactory }, { token: EntityDefinitionService }, { token: EntitySelectorsFactory }, { token: EntitySelectors$Factory }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3043
|
+
/** @nocollapse */ EntityCollectionServiceElementsFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceElementsFactory });
|
|
3044
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceElementsFactory, decorators: [{
|
|
3045
|
+
type: i0.Injectable
|
|
3046
|
+
}], ctorParameters: function () { return [{ type: EntityDispatcherFactory }, { type: EntityDefinitionService }, { type: EntitySelectorsFactory }, { type: EntitySelectors$Factory }]; } });
|
|
3015
3047
|
|
|
3016
3048
|
/**
|
|
3017
3049
|
* Creates EntityCollectionService instances for
|
|
@@ -3032,13 +3064,11 @@
|
|
|
3032
3064
|
};
|
|
3033
3065
|
return EntityCollectionServiceFactory;
|
|
3034
3066
|
}());
|
|
3035
|
-
EntityCollectionServiceFactory
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
{ type: EntityCollectionServiceElementsFactory }
|
|
3041
|
-
]; };
|
|
3067
|
+
/** @nocollapse */ EntityCollectionServiceFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceFactory, deps: [{ token: EntityCollectionServiceElementsFactory }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3068
|
+
/** @nocollapse */ EntityCollectionServiceFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceFactory });
|
|
3069
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionServiceFactory, decorators: [{
|
|
3070
|
+
type: i0.Injectable
|
|
3071
|
+
}], ctorParameters: function () { return [{ type: EntityCollectionServiceElementsFactory }]; } });
|
|
3042
3072
|
|
|
3043
3073
|
/** Core ingredients of an EntityServices class */
|
|
3044
3074
|
var EntityServicesElements = /** @class */ (function () {
|
|
@@ -3062,16 +3092,11 @@
|
|
|
3062
3092
|
}
|
|
3063
3093
|
return EntityServicesElements;
|
|
3064
3094
|
}());
|
|
3065
|
-
EntityServicesElements
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
{ type: EntityCollectionServiceFactory },
|
|
3071
|
-
{ type: EntityDispatcherFactory },
|
|
3072
|
-
{ type: EntitySelectors$Factory },
|
|
3073
|
-
{ type: store.Store }
|
|
3074
|
-
]; };
|
|
3095
|
+
/** @nocollapse */ EntityServicesElements.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesElements, deps: [{ token: EntityCollectionServiceFactory }, { token: EntityDispatcherFactory }, { token: EntitySelectors$Factory }, { token: i1__namespace$1.Store }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3096
|
+
/** @nocollapse */ EntityServicesElements.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesElements });
|
|
3097
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesElements, decorators: [{
|
|
3098
|
+
type: i0.Injectable
|
|
3099
|
+
}], ctorParameters: function () { return [{ type: EntityCollectionServiceFactory }, { type: EntityDispatcherFactory }, { type: EntitySelectors$Factory }, { type: i1__namespace$1.Store }]; } });
|
|
3075
3100
|
|
|
3076
3101
|
/* eslint-disable @typescript-eslint/member-ordering */
|
|
3077
3102
|
/**
|
|
@@ -3205,13 +3230,11 @@
|
|
|
3205
3230
|
};
|
|
3206
3231
|
return EntityServicesBase;
|
|
3207
3232
|
}());
|
|
3208
|
-
EntityServicesBase
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
{ type: EntityServicesElements }
|
|
3214
|
-
]; };
|
|
3233
|
+
/** @nocollapse */ EntityServicesBase.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesBase, deps: [{ token: EntityServicesElements }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
3234
|
+
/** @nocollapse */ EntityServicesBase.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesBase });
|
|
3235
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityServicesBase, decorators: [{
|
|
3236
|
+
type: i0.Injectable
|
|
3237
|
+
}], ctorParameters: function () { return [{ type: EntityServicesElements }]; } });
|
|
3215
3238
|
|
|
3216
3239
|
/* eslint-disable @typescript-eslint/member-ordering */
|
|
3217
3240
|
/**
|
|
@@ -4594,13 +4617,11 @@
|
|
|
4594
4617
|
};
|
|
4595
4618
|
return EntityCollectionReducerMethodsFactory;
|
|
4596
4619
|
}());
|
|
4597
|
-
EntityCollectionReducerMethodsFactory
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
{ type: EntityDefinitionService }
|
|
4603
|
-
]; };
|
|
4620
|
+
/** @nocollapse */ EntityCollectionReducerMethodsFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerMethodsFactory, deps: [{ token: EntityDefinitionService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
4621
|
+
/** @nocollapse */ EntityCollectionReducerMethodsFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerMethodsFactory });
|
|
4622
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerMethodsFactory, decorators: [{
|
|
4623
|
+
type: i0.Injectable
|
|
4624
|
+
}], ctorParameters: function () { return [{ type: EntityDefinitionService }]; } });
|
|
4604
4625
|
|
|
4605
4626
|
/** Create a default reducer for a specific entity collection */
|
|
4606
4627
|
var EntityCollectionReducerFactory = /** @class */ (function () {
|
|
@@ -4618,13 +4639,11 @@
|
|
|
4618
4639
|
};
|
|
4619
4640
|
return EntityCollectionReducerFactory;
|
|
4620
4641
|
}());
|
|
4621
|
-
EntityCollectionReducerFactory
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
{ type: EntityCollectionReducerMethodsFactory }
|
|
4627
|
-
]; };
|
|
4642
|
+
/** @nocollapse */ EntityCollectionReducerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerFactory, deps: [{ token: EntityCollectionReducerMethodsFactory }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
4643
|
+
/** @nocollapse */ EntityCollectionReducerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerFactory });
|
|
4644
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerFactory, decorators: [{
|
|
4645
|
+
type: i0.Injectable
|
|
4646
|
+
}], ctorParameters: function () { return [{ type: EntityCollectionReducerMethodsFactory }]; } });
|
|
4628
4647
|
|
|
4629
4648
|
/**
|
|
4630
4649
|
* Registry of entity types and their previously-constructed reducers.
|
|
@@ -4635,7 +4654,7 @@
|
|
|
4635
4654
|
this.entityCollectionReducerFactory = entityCollectionReducerFactory;
|
|
4636
4655
|
this.entityCollectionReducers = {};
|
|
4637
4656
|
// eslint-disable-next-line prefer-spread
|
|
4638
|
-
this.entityCollectionMetaReducer =
|
|
4657
|
+
this.entityCollectionMetaReducer = i1$1.compose.apply(null, entityCollectionMetaReducers || []);
|
|
4639
4658
|
}
|
|
4640
4659
|
/**
|
|
4641
4660
|
* Get the registered EntityCollectionReducer<T> for this entity type or create one and register it.
|
|
@@ -4680,14 +4699,18 @@
|
|
|
4680
4699
|
};
|
|
4681
4700
|
return EntityCollectionReducerRegistry;
|
|
4682
4701
|
}());
|
|
4683
|
-
EntityCollectionReducerRegistry
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4702
|
+
/** @nocollapse */ EntityCollectionReducerRegistry.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerRegistry, deps: [{ token: EntityCollectionReducerFactory }, { token: ENTITY_COLLECTION_META_REDUCERS, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
4703
|
+
/** @nocollapse */ EntityCollectionReducerRegistry.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerRegistry });
|
|
4704
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCollectionReducerRegistry, decorators: [{
|
|
4705
|
+
type: i0.Injectable
|
|
4706
|
+
}], ctorParameters: function () {
|
|
4707
|
+
return [{ type: EntityCollectionReducerFactory }, { type: undefined, decorators: [{
|
|
4708
|
+
type: i0.Optional
|
|
4709
|
+
}, {
|
|
4710
|
+
type: i0.Inject,
|
|
4711
|
+
args: [ENTITY_COLLECTION_META_REDUCERS]
|
|
4712
|
+
}] }];
|
|
4713
|
+
} });
|
|
4691
4714
|
|
|
4692
4715
|
/**
|
|
4693
4716
|
* Creates the EntityCacheReducer via its create() method
|
|
@@ -4954,15 +4977,11 @@
|
|
|
4954
4977
|
};
|
|
4955
4978
|
return EntityCacheReducerFactory;
|
|
4956
4979
|
}());
|
|
4957
|
-
EntityCacheReducerFactory
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
{ type: EntityCollectionCreator },
|
|
4963
|
-
{ type: EntityCollectionReducerRegistry },
|
|
4964
|
-
{ type: Logger }
|
|
4965
|
-
]; };
|
|
4980
|
+
/** @nocollapse */ EntityCacheReducerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheReducerFactory, deps: [{ token: EntityCollectionCreator }, { token: EntityCollectionReducerRegistry }, { token: Logger }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
4981
|
+
/** @nocollapse */ EntityCacheReducerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheReducerFactory });
|
|
4982
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityCacheReducerFactory, decorators: [{
|
|
4983
|
+
type: i0.Injectable
|
|
4984
|
+
}], ctorParameters: function () { return [{ type: EntityCollectionCreator }, { type: EntityCollectionReducerRegistry }, { type: Logger }]; } });
|
|
4966
4985
|
|
|
4967
4986
|
var DefaultLogger = /** @class */ (function () {
|
|
4968
4987
|
function DefaultLogger() {
|
|
@@ -4984,9 +5003,11 @@
|
|
|
4984
5003
|
};
|
|
4985
5004
|
return DefaultLogger;
|
|
4986
5005
|
}());
|
|
4987
|
-
DefaultLogger
|
|
4988
|
-
|
|
4989
|
-
|
|
5006
|
+
/** @nocollapse */ DefaultLogger.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultLogger, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
5007
|
+
/** @nocollapse */ DefaultLogger.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultLogger });
|
|
5008
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultLogger, decorators: [{
|
|
5009
|
+
type: i0.Injectable
|
|
5010
|
+
}] });
|
|
4990
5011
|
|
|
4991
5012
|
var uncountable = [
|
|
4992
5013
|
// 'sheep',
|
|
@@ -5047,13 +5068,18 @@
|
|
|
5047
5068
|
};
|
|
5048
5069
|
return DefaultPluralizer;
|
|
5049
5070
|
}());
|
|
5050
|
-
DefaultPluralizer
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5071
|
+
/** @nocollapse */ DefaultPluralizer.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPluralizer, deps: [{ token: PLURAL_NAMES_TOKEN, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
5072
|
+
/** @nocollapse */ DefaultPluralizer.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPluralizer });
|
|
5073
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: DefaultPluralizer, decorators: [{
|
|
5074
|
+
type: i0.Injectable
|
|
5075
|
+
}], ctorParameters: function () {
|
|
5076
|
+
return [{ type: undefined, decorators: [{
|
|
5077
|
+
type: i0.Optional
|
|
5078
|
+
}, {
|
|
5079
|
+
type: i0.Inject,
|
|
5080
|
+
args: [PLURAL_NAMES_TOKEN]
|
|
5081
|
+
}] }];
|
|
5082
|
+
} });
|
|
5057
5083
|
|
|
5058
5084
|
/**
|
|
5059
5085
|
Client-side id-generators
|
|
@@ -5124,7 +5150,6 @@
|
|
|
5124
5150
|
: +(l !== r);
|
|
5125
5151
|
}
|
|
5126
5152
|
|
|
5127
|
-
var ɵ0 = ENTITY_CACHE_NAME;
|
|
5128
5153
|
/**
|
|
5129
5154
|
* Module without effects or dataservices which means no HTTP calls
|
|
5130
5155
|
* This module helpful for internal testing.
|
|
@@ -5146,12 +5171,12 @@
|
|
|
5146
5171
|
initialState =
|
|
5147
5172
|
typeof initialState === 'function' ? initialState() : initialState;
|
|
5148
5173
|
var reducers = (metaReducers || []).map(function (mr) {
|
|
5149
|
-
return mr instanceof
|
|
5174
|
+
return mr instanceof i0.InjectionToken ? injector.get(mr) : mr;
|
|
5150
5175
|
});
|
|
5151
5176
|
this.entityCacheFeature = {
|
|
5152
5177
|
key: key,
|
|
5153
5178
|
reducers: entityCacheReducerFactory.create(),
|
|
5154
|
-
reducerFactory:
|
|
5179
|
+
reducerFactory: i1$1.combineReducers,
|
|
5155
5180
|
initialState: initialState || {},
|
|
5156
5181
|
metaReducers: reducers,
|
|
5157
5182
|
};
|
|
@@ -5187,44 +5212,79 @@
|
|
|
5187
5212
|
};
|
|
5188
5213
|
return EntityDataModuleWithoutEffects;
|
|
5189
5214
|
}());
|
|
5190
|
-
EntityDataModuleWithoutEffects
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5215
|
+
/** @nocollapse */ EntityDataModuleWithoutEffects.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModuleWithoutEffects, deps: [{ token: i1__namespace$1.ReducerManager }, { token: EntityCacheReducerFactory }, { token: i0__namespace.Injector }, { token: ENTITY_CACHE_NAME_TOKEN, optional: true }, { token: INITIAL_ENTITY_CACHE_STATE, optional: true }, { token: ENTITY_CACHE_META_REDUCERS, optional: true }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
5216
|
+
/** @nocollapse */ EntityDataModuleWithoutEffects.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModuleWithoutEffects, imports: [i1$1.StoreModule] });
|
|
5217
|
+
/** @nocollapse */ EntityDataModuleWithoutEffects.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModuleWithoutEffects, providers: [
|
|
5218
|
+
CorrelationIdGenerator,
|
|
5219
|
+
EntityDispatcherDefaultOptions,
|
|
5220
|
+
EntityActionFactory,
|
|
5221
|
+
EntityCacheDispatcher,
|
|
5222
|
+
EntityCacheReducerFactory,
|
|
5223
|
+
entityCacheSelectorProvider,
|
|
5224
|
+
EntityCollectionCreator,
|
|
5225
|
+
EntityCollectionReducerFactory,
|
|
5226
|
+
EntityCollectionReducerMethodsFactory,
|
|
5227
|
+
EntityCollectionReducerRegistry,
|
|
5228
|
+
EntityCollectionServiceElementsFactory,
|
|
5229
|
+
EntityCollectionServiceFactory,
|
|
5230
|
+
EntityDefinitionService,
|
|
5231
|
+
EntityDispatcherFactory,
|
|
5232
|
+
EntitySelectorsFactory,
|
|
5233
|
+
EntitySelectors$Factory,
|
|
5234
|
+
EntityServicesElements,
|
|
5235
|
+
{ provide: ENTITY_CACHE_NAME_TOKEN, useValue: ENTITY_CACHE_NAME },
|
|
5236
|
+
{ provide: EntityServices, useClass: EntityServicesBase },
|
|
5237
|
+
{ provide: Logger, useClass: DefaultLogger },
|
|
5238
|
+
], imports: [[
|
|
5239
|
+
i1$1.StoreModule, // rely on Store feature providers rather than Store.forFeature()
|
|
5240
|
+
]] });
|
|
5241
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModuleWithoutEffects, decorators: [{
|
|
5242
|
+
type: i0.NgModule,
|
|
5243
|
+
args: [{
|
|
5244
|
+
imports: [
|
|
5245
|
+
i1$1.StoreModule, // rely on Store feature providers rather than Store.forFeature()
|
|
5246
|
+
],
|
|
5247
|
+
providers: [
|
|
5248
|
+
CorrelationIdGenerator,
|
|
5249
|
+
EntityDispatcherDefaultOptions,
|
|
5250
|
+
EntityActionFactory,
|
|
5251
|
+
EntityCacheDispatcher,
|
|
5252
|
+
EntityCacheReducerFactory,
|
|
5253
|
+
entityCacheSelectorProvider,
|
|
5254
|
+
EntityCollectionCreator,
|
|
5255
|
+
EntityCollectionReducerFactory,
|
|
5256
|
+
EntityCollectionReducerMethodsFactory,
|
|
5257
|
+
EntityCollectionReducerRegistry,
|
|
5258
|
+
EntityCollectionServiceElementsFactory,
|
|
5259
|
+
EntityCollectionServiceFactory,
|
|
5260
|
+
EntityDefinitionService,
|
|
5261
|
+
EntityDispatcherFactory,
|
|
5262
|
+
EntitySelectorsFactory,
|
|
5263
|
+
EntitySelectors$Factory,
|
|
5264
|
+
EntityServicesElements,
|
|
5265
|
+
{ provide: ENTITY_CACHE_NAME_TOKEN, useValue: ENTITY_CACHE_NAME },
|
|
5266
|
+
{ provide: EntityServices, useClass: EntityServicesBase },
|
|
5267
|
+
{ provide: Logger, useClass: DefaultLogger },
|
|
5268
|
+
],
|
|
5269
|
+
}]
|
|
5270
|
+
}], ctorParameters: function () {
|
|
5271
|
+
return [{ type: i1__namespace$1.ReducerManager }, { type: EntityCacheReducerFactory }, { type: i0__namespace.Injector }, { type: undefined, decorators: [{
|
|
5272
|
+
type: i0.Optional
|
|
5273
|
+
}, {
|
|
5274
|
+
type: i0.Inject,
|
|
5275
|
+
args: [ENTITY_CACHE_NAME_TOKEN]
|
|
5276
|
+
}] }, { type: undefined, decorators: [{
|
|
5277
|
+
type: i0.Optional
|
|
5278
|
+
}, {
|
|
5279
|
+
type: i0.Inject,
|
|
5280
|
+
args: [INITIAL_ENTITY_CACHE_STATE]
|
|
5281
|
+
}] }, { type: undefined, decorators: [{
|
|
5282
|
+
type: i0.Optional
|
|
5283
|
+
}, {
|
|
5284
|
+
type: i0.Inject,
|
|
5285
|
+
args: [ENTITY_CACHE_META_REDUCERS]
|
|
5286
|
+
}] }];
|
|
5287
|
+
} });
|
|
5228
5288
|
|
|
5229
5289
|
/**
|
|
5230
5290
|
* entity-data main module includes effects and HTTP data services
|
|
@@ -5288,33 +5348,47 @@
|
|
|
5288
5348
|
};
|
|
5289
5349
|
return EntityDataModule;
|
|
5290
5350
|
}());
|
|
5291
|
-
EntityDataModule
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5351
|
+
/** @nocollapse */ EntityDataModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModule, deps: [{ token: i1__namespace$2.EffectSources }, { token: EntityCacheEffects }, { token: EntityEffects }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
5352
|
+
/** @nocollapse */ EntityDataModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModule, imports: [EntityDataModuleWithoutEffects,
|
|
5353
|
+
i1$2.EffectsModule] });
|
|
5354
|
+
/** @nocollapse */ EntityDataModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModule, providers: [
|
|
5355
|
+
DefaultDataServiceFactory,
|
|
5356
|
+
EntityCacheDataService,
|
|
5357
|
+
EntityDataService,
|
|
5358
|
+
EntityCacheEffects,
|
|
5359
|
+
EntityEffects,
|
|
5360
|
+
{ provide: HttpUrlGenerator, useClass: DefaultHttpUrlGenerator },
|
|
5361
|
+
{
|
|
5362
|
+
provide: PersistenceResultHandler,
|
|
5363
|
+
useClass: DefaultPersistenceResultHandler,
|
|
5364
|
+
},
|
|
5365
|
+
{ provide: Pluralizer, useClass: DefaultPluralizer },
|
|
5366
|
+
], imports: [[
|
|
5367
|
+
EntityDataModuleWithoutEffects,
|
|
5368
|
+
i1$2.EffectsModule, // do not supply effects because can't replace later
|
|
5369
|
+
]] });
|
|
5370
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.6", ngImport: i0__namespace, type: EntityDataModule, decorators: [{
|
|
5371
|
+
type: i0.NgModule,
|
|
5372
|
+
args: [{
|
|
5373
|
+
imports: [
|
|
5374
|
+
EntityDataModuleWithoutEffects,
|
|
5375
|
+
i1$2.EffectsModule, // do not supply effects because can't replace later
|
|
5376
|
+
],
|
|
5377
|
+
providers: [
|
|
5378
|
+
DefaultDataServiceFactory,
|
|
5379
|
+
EntityCacheDataService,
|
|
5380
|
+
EntityDataService,
|
|
5381
|
+
EntityCacheEffects,
|
|
5382
|
+
EntityEffects,
|
|
5383
|
+
{ provide: HttpUrlGenerator, useClass: DefaultHttpUrlGenerator },
|
|
5384
|
+
{
|
|
5385
|
+
provide: PersistenceResultHandler,
|
|
5386
|
+
useClass: DefaultPersistenceResultHandler,
|
|
5387
|
+
},
|
|
5388
|
+
{ provide: Pluralizer, useClass: DefaultPluralizer },
|
|
5389
|
+
],
|
|
5390
|
+
}]
|
|
5391
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$2.EffectSources }, { type: EntityCacheEffects }, { type: EntityEffects }]; } });
|
|
5318
5392
|
|
|
5319
5393
|
// actions
|
|
5320
5394
|
|
|
@@ -5410,7 +5484,6 @@
|
|
|
5410
5484
|
exports.ofEntityType = ofEntityType;
|
|
5411
5485
|
exports.persistOps = persistOps;
|
|
5412
5486
|
exports.toUpdateFactory = toUpdateFactory;
|
|
5413
|
-
exports.ɵa = ENTITY_EFFECTS_SCHEDULER;
|
|
5414
5487
|
|
|
5415
5488
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5416
5489
|
|