@sumaris-net/ngx-components 1.23.56 → 1.23.57

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.
@@ -13818,7 +13818,7 @@
13818
13818
  function EntityStore(name, storage, policy) {
13819
13819
  this.name = name;
13820
13820
  this.storage = storage;
13821
- this._onChange = new rxjs.BehaviorSubject(false);
13821
+ this._onChange = new rxjs.BehaviorSubject(true);
13822
13822
  this._dirty = false;
13823
13823
  this.policy = policy || {};
13824
13824
  this.reset({ emitEvent: false });
@@ -13897,9 +13897,7 @@
13897
13897
  console.warn('[entity-store] WARN: Watching full entities, splited by id in entity store. This can be long! Please make sure you need full entities here.');
13898
13898
  return this._onChange
13899
13899
  .pipe(
13900
- // Wait data loaded
13901
- operators.filter(function (_) { return _this._loaded; }),
13902
- // Apply filter and sort
13900
+ // Apply filter on cache
13903
13901
  operators.map(function (_) { return _this.reduceAndSort(_this._cache, variables); }),
13904
13902
  // Then convert into full entities (using parallel jobs - /!\ can use lot of memory)
13905
13903
  operators.mergeMap(function (res) { return Promise.all((res.data || [])
@@ -13910,11 +13908,7 @@
13910
13908
  }
13911
13909
  // Load using entities array
13912
13910
  return this._onChange
13913
- .pipe(
13914
- // Wait data loaded
13915
- operators.filter(function (_) { return _this._loaded; }),
13916
- // Apply filter and sort
13917
- operators.map(function (_) { return _this.reduceAndSort(_this._cache, variables); }));
13911
+ .pipe(operators.map(function (_) { return _this.reduceAndSort(_this._cache, variables); }));
13918
13912
  };
13919
13913
  /**
13920
13914
  * WIll apply a filter, then a sort, then a page slice
@@ -13982,7 +13976,7 @@
13982
13976
  var result;
13983
13977
  console.info("[entity-storage] Saving " + entities.length + " " + this.name + "(s)");
13984
13978
  // First save, or reset using given entities
13985
- if (!this._loaded || !this._cache || (opts === null || opts === void 0 ? void 0 : opts.reset)) {
13979
+ if (isEmptyArray(this._cache) || (opts && opts.reset)) {
13986
13980
  this.setEntities(entities, { emitEvent: false });
13987
13981
  }
13988
13982
  else {