diff --git a/packages/unpublished-adapter-encapsulation-test-app/app/services/store.js b/packages/unpublished-adapter-encapsulation-test-app/app/services/store.js index f3fd25b012e..dfebabf192a 100644 --- a/packages/unpublished-adapter-encapsulation-test-app/app/services/store.js +++ b/packages/unpublished-adapter-encapsulation-test-app/app/services/store.js @@ -1,8 +1,15 @@ +import { V2CACHE_SINGLETON_RECORD_DATA } from '@ember-data/canary-features'; import { RecordData } from '@ember-data/record-data/-private'; import Store from '@ember-data/store'; export default class DefaultStore extends Store { createRecordDataFor(identifier, storeWrapper) { + if (V2CACHE_SINGLETON_RECORD_DATA) { + // @ts-expect-error + this.__private_singleton_recordData = this.__private_singleton_recordData || new RecordData(storeWrapper); + this.__private_singleton_recordData.createCache(identifier); + return this.__private_singleton_recordData; + } return new RecordData(identifier, storeWrapper); } } diff --git a/packages/unpublished-serializer-encapsulation-test-app/app/services/store.js b/packages/unpublished-serializer-encapsulation-test-app/app/services/store.js index f3fd25b012e..dfebabf192a 100644 --- a/packages/unpublished-serializer-encapsulation-test-app/app/services/store.js +++ b/packages/unpublished-serializer-encapsulation-test-app/app/services/store.js @@ -1,8 +1,15 @@ +import { V2CACHE_SINGLETON_RECORD_DATA } from '@ember-data/canary-features'; import { RecordData } from '@ember-data/record-data/-private'; import Store from '@ember-data/store'; export default class DefaultStore extends Store { createRecordDataFor(identifier, storeWrapper) { + if (V2CACHE_SINGLETON_RECORD_DATA) { + // @ts-expect-error + this.__private_singleton_recordData = this.__private_singleton_recordData || new RecordData(storeWrapper); + this.__private_singleton_recordData.createCache(identifier); + return this.__private_singleton_recordData; + } return new RecordData(identifier, storeWrapper); } }