@smartsoft001/crud-shell-angular 2.94.0 → 2.96.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.
|
@@ -290,39 +290,31 @@ const getCrudError = (entity) => createSelector(getCrudState(entity), (state) =>
|
|
|
290
290
|
class CrudFacade {
|
|
291
291
|
store;
|
|
292
292
|
config;
|
|
293
|
+
loaded;
|
|
294
|
+
loading;
|
|
295
|
+
selected;
|
|
296
|
+
multiSelected;
|
|
297
|
+
list;
|
|
298
|
+
filter;
|
|
299
|
+
totalCount;
|
|
300
|
+
links;
|
|
301
|
+
error;
|
|
293
302
|
constructor(store, config) {
|
|
294
303
|
this.store = store;
|
|
295
304
|
this.config = config;
|
|
296
305
|
if (NgrxStoreService.store) {
|
|
297
306
|
this.store = NgrxStoreService.store;
|
|
298
307
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
get multiSelected() {
|
|
310
|
-
return toSignal(this.store.pipe(select$1(getCrudMultiSelected(this.config.entity))));
|
|
311
|
-
}
|
|
312
|
-
get list() {
|
|
313
|
-
return toSignal(this.store.pipe(select$1(getCrudList(this.config.entity))));
|
|
314
|
-
}
|
|
315
|
-
get filter() {
|
|
316
|
-
return toSignal(this.store.pipe(select$1(getCrudFilter(this.config.entity))));
|
|
317
|
-
}
|
|
318
|
-
get totalCount() {
|
|
319
|
-
return toSignal(this.store.pipe(select$1(getCrudTotalCount(this.config.entity))));
|
|
320
|
-
}
|
|
321
|
-
get links() {
|
|
322
|
-
return toSignal(this.store.pipe(select$1(getCrudLinks(this.config.entity))));
|
|
323
|
-
}
|
|
324
|
-
get error() {
|
|
325
|
-
return toSignal(this.store.pipe(select$1(getCrudError(this.config.entity))));
|
|
308
|
+
// Initialize all signals in the constructor (injection context)
|
|
309
|
+
this.loaded = toSignal(this.store.pipe(select$1(getCrudLoaded(this.config.entity))));
|
|
310
|
+
this.loading = toSignal(this.store.pipe(select$1(getCrudLoaded(this.config.entity)), map((l) => !l)));
|
|
311
|
+
this.selected = toSignal(this.store.pipe(select$1(getCrudSelected(this.config.entity))));
|
|
312
|
+
this.multiSelected = toSignal(this.store.pipe(select$1(getCrudMultiSelected(this.config.entity))));
|
|
313
|
+
this.list = toSignal(this.store.pipe(select$1(getCrudList(this.config.entity))));
|
|
314
|
+
this.filter = toSignal(this.store.pipe(select$1(getCrudFilter(this.config.entity))));
|
|
315
|
+
this.totalCount = toSignal(this.store.pipe(select$1(getCrudTotalCount(this.config.entity))));
|
|
316
|
+
this.links = toSignal(this.store.pipe(select$1(getCrudLinks(this.config.entity))));
|
|
317
|
+
this.error = toSignal(this.store.pipe(select$1(getCrudError(this.config.entity))));
|
|
326
318
|
}
|
|
327
319
|
create(item) {
|
|
328
320
|
this.store.dispatch(create(this.config.entity, item));
|