ywana-core8 0.0.768 → 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.umd.js CHANGED
@@ -10355,6 +10355,8 @@
10355
10355
 
10356
10356
  var load = function load() {
10357
10357
  try {
10358
+ var _exit2;
10359
+
10358
10360
  var runCustomFilters = function runCustomFilters(all) {
10359
10361
  var cfs = Object.values(customFilters);
10360
10362
  var data = cfs.length ? cfs.reduce(function (acc, filter) {
@@ -10363,17 +10365,16 @@
10363
10365
  return data;
10364
10366
  };
10365
10367
 
10366
- var _temp4 = _catch$1(function () {
10368
+ return Promise.resolve(_catch$1(function () {
10367
10369
  return Promise.resolve(API.all(filters, likes, page)).then(function (response) {
10368
10370
  var next = field ? response[field] : response;
10369
10371
  var data = runCustomFilters(next);
10370
- setAll(data);
10372
+ _exit2 = 1;
10373
+ return data;
10371
10374
  });
10372
10375
  }, function (error) {
10373
10376
  console.log(error);
10374
- });
10375
-
10376
- return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
10377
+ }));
10377
10378
  } catch (e) {
10378
10379
  return Promise.reject(e);
10379
10380
  }
@@ -10415,7 +10416,19 @@
10415
10416
 
10416
10417
  React.useEffect(function () {
10417
10418
  console.log("CONTEXT LOAD for Filters", filters, customFilters);
10418
- load();
10419
+ var mounted = true;
10420
+
10421
+ var callLoad = function callLoad() {
10422
+ return Promise.resolve(load()).then(function (data) {
10423
+ if (mounted) setAll(data);
10424
+ });
10425
+ };
10426
+
10427
+ callLoad();
10428
+ return function () {
10429
+ console.log("CONTEXT UNMOUNT", filters, customFilters);
10430
+ mounted = false;
10431
+ };
10419
10432
  }, [filters, customFilters]);
10420
10433
 
10421
10434
  function clearSelection() {