@ember-data/store 4.12.0-beta.2 → 4.12.0-beta.3

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/addon/-private.js CHANGED
@@ -1 +1 @@
1
- export { C as AdapterPopulatedRecordArray, j as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, h as SOURCE, a as Snapshot, l as SnapshotRecordArray, S as Store, f as coerceId, k as fastPush, i as isStableIdentifier, n as normalizeModelName, g as notifyArray, m as recordDataFor, r as recordIdentifierFor, o as removeRecordDataFor, d as setIdentifierForgetMethod, b as setIdentifierGenerationMethod, e as setIdentifierResetMethod, c as setIdentifierUpdateMethod, s as storeFor } from "./index-6511184b";
1
+ export { C as AdapterPopulatedRecordArray, j as IDENTIFIER_ARRAY_TAG, I as IdentifierArray, M as MUTATE, I as RecordArray, R as RecordArrayManager, h as SOURCE, a as Snapshot, l as SnapshotRecordArray, S as Store, _ as _clearCaches, f as coerceId, k as fastPush, i as isStableIdentifier, n as normalizeModelName, g as notifyArray, m as recordDataFor, r as recordIdentifierFor, o as removeRecordDataFor, d as setIdentifierForgetMethod, b as setIdentifierGenerationMethod, e as setIdentifierResetMethod, c as setIdentifierUpdateMethod, s as storeFor } from "./index-bebb407b";
@@ -2804,6 +2804,7 @@ class InstanceCache {
2804
2804
  getRecord(identifier, properties) {
2805
2805
  let record = this.__instances.record.get(identifier);
2806
2806
  if (!record) {
2807
+ assert(`Cannot create a new record instance while the store is being destroyed`, !this.store.isDestroying && !this.store.isDestroyed);
2807
2808
  const recordData = this.getRecordData(identifier);
2808
2809
  record = this.store.instantiateRecord(identifier, properties || {}, this.__recordDataFor, this.store.notifications);
2809
2810
  setRecordIdentifier(record, identifier);
@@ -3181,6 +3182,11 @@ function _isLoading(cache, identifier) {
3181
3182
  // fulfilled === null &&
3182
3183
  req.getPendingRequestsForRecord(identifier).some(req => req.type === 'query');
3183
3184
  }
3185
+ function _clearCaches() {
3186
+ RecordCache.clear();
3187
+ StoreMap.clear();
3188
+ RecordDataForIdentifierCache.clear();
3189
+ }
3184
3190
  let _modelForMixin;
3185
3191
  if (macroCondition(dependencySatisfies("@ember-data/model", "*"))) {
3186
3192
  let _found;
@@ -3454,7 +3460,7 @@ function promiseArray(promise) {
3454
3460
  return Reflect.get(target, prop, receiver);
3455
3461
  }
3456
3462
  if (ALLOWABLE_PROPS.includes(prop)) {
3457
- return receiver[prop];
3463
+ return target[prop];
3458
3464
  }
3459
3465
  if (!ALLOWABLE_METHODS.includes(prop)) {
3460
3466
  deprecate(`Accessing ${prop} on this PromiseArray is deprecated. The return type is being changed from PromiseArray to a Promise. The only available methods to access on this promise are .then, .catch and .finally`, false, {
@@ -3497,7 +3503,7 @@ function promiseObject(promise) {
3497
3503
  return target.constructor;
3498
3504
  }
3499
3505
  if (ALLOWABLE_PROPS.includes(prop)) {
3500
- return receiver[prop];
3506
+ return target[prop];
3501
3507
  }
3502
3508
  if (!ALLOWABLE_METHODS.includes(prop)) {
3503
3509
  deprecate(`Accessing ${prop} on this PromiseObject is deprecated. The return type is being changed from PromiseObject to a Promise. The only available methods to access on this promise are .then, .catch and .finally`, false, {
@@ -7687,4 +7693,4 @@ function normalizeModelName(modelName) {
7687
7693
  }
7688
7694
  assert(`normalizeModelName support has been removed`);
7689
7695
  }
7690
- export { Collection as C, IdentifierArray as I, MUTATE as M, RecordArrayManager as R, Store as S, Snapshot as a, setIdentifierGenerationMethod as b, setIdentifierUpdateMethod as c, setIdentifierForgetMethod as d, setIdentifierResetMethod as e, coerceId as f, notifyArray as g, SOURCE as h, isStableIdentifier as i, IDENTIFIER_ARRAY_TAG as j, fastPush as k, SnapshotRecordArray as l, recordDataFor as m, normalizeModelName as n, removeRecordDataFor as o, recordIdentifierFor as r, storeFor as s };
7696
+ export { Collection as C, IdentifierArray as I, MUTATE as M, RecordArrayManager as R, Store as S, _clearCaches as _, Snapshot as a, setIdentifierGenerationMethod as b, setIdentifierUpdateMethod as c, setIdentifierForgetMethod as d, setIdentifierResetMethod as e, coerceId as f, notifyArray as g, SOURCE as h, isStableIdentifier as i, IDENTIFIER_ARRAY_TAG as j, fastPush as k, SnapshotRecordArray as l, recordDataFor as m, normalizeModelName as n, removeRecordDataFor as o, recordIdentifierFor as r, storeFor as s };