ywana-core8 0.0.767 → 0.0.769
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/dist/index.cjs +19 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +19 -27
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +19 -27
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain2/CollectionContext.js +16 -18
package/dist/index.modern.js
CHANGED
@@ -10353,6 +10353,8 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
10353
10353
|
|
10354
10354
|
var load = function load() {
|
10355
10355
|
try {
|
10356
|
+
var _exit2;
|
10357
|
+
|
10356
10358
|
var runCustomFilters = function runCustomFilters(all) {
|
10357
10359
|
var cfs = Object.values(customFilters);
|
10358
10360
|
var data = cfs.length ? cfs.reduce(function (acc, filter) {
|
@@ -10361,17 +10363,16 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
10361
10363
|
return data;
|
10362
10364
|
};
|
10363
10365
|
|
10364
|
-
|
10366
|
+
return Promise.resolve(_catch$1(function () {
|
10365
10367
|
return Promise.resolve(API.all(filters, likes, page)).then(function (response) {
|
10366
10368
|
var next = field ? response[field] : response;
|
10367
10369
|
var data = runCustomFilters(next);
|
10368
|
-
|
10370
|
+
_exit2 = 1;
|
10371
|
+
return data;
|
10369
10372
|
});
|
10370
10373
|
}, function (error) {
|
10371
10374
|
console.log(error);
|
10372
|
-
});
|
10373
|
-
|
10374
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
10375
|
+
}));
|
10375
10376
|
} catch (e) {
|
10376
10377
|
return Promise.reject(e);
|
10377
10378
|
}
|
@@ -10412,30 +10413,21 @@ var CollectionContextProvider = function CollectionContextProvider(props) {
|
|
10412
10413
|
setSelected = _useState6[1];
|
10413
10414
|
|
10414
10415
|
useEffect(function () {
|
10415
|
-
|
10416
|
-
|
10417
|
-
|
10418
|
-
|
10416
|
+
console.log("CONTEXT LOAD for Filters", filters, customFilters);
|
10417
|
+
var mounted = true;
|
10418
|
+
|
10419
|
+
var callLoad = function callLoad() {
|
10420
|
+
return Promise.resolve(load()).then(function (data) {
|
10421
|
+
if (mounted) setAll(data);
|
10419
10422
|
});
|
10420
|
-
}
|
10421
|
-
return Promise.reject(e);
|
10422
|
-
}
|
10423
|
-
}, [filters]);
|
10424
|
-
useEffect(function () {
|
10425
|
-
if (Object.keys(customFilters).length > 0) {
|
10426
|
-
console.log("CONTEXT CustomFilters", customFilters);
|
10427
|
-
filter();
|
10428
|
-
}
|
10429
|
-
}, [customFilters]);
|
10423
|
+
};
|
10430
10424
|
|
10431
|
-
|
10432
|
-
|
10433
|
-
|
10434
|
-
|
10435
|
-
|
10436
|
-
|
10437
|
-
return data;
|
10438
|
-
}
|
10425
|
+
callLoad();
|
10426
|
+
return function () {
|
10427
|
+
console.log("CONTEXT UNMOUNT", filters, customFilters);
|
10428
|
+
mounted = false;
|
10429
|
+
};
|
10430
|
+
}, [filters, customFilters]);
|
10439
10431
|
|
10440
10432
|
function clearSelection() {
|
10441
10433
|
setSelected(null);
|