@ember-data-types/store 5.4.0-alpha.57 → 5.4.0-alpha.59
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-handler.d.ts","sourceRoot":"","sources":["../../src/-private/cache-handler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAGV,oBAAoB,EAEpB,cAAc,EACd,YAAY,EAGb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAa,MAAM,gCAAgC,CAAC;AAO5E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAC3E;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,UAAU,EAAE,wBAAwB,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;IAE3E;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAE7G;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,CACT,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,EACxC,UAAU,EAAE,wBAAwB,GAAG,IAAI,EAC3C,KAAK,EAAE,KAAK,GACX,I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
|
447
447
|
To create a new instance of a `Post` that has a relationship with a `User` record:
|
|
448
448
|
|
|
449
449
|
```js
|
|
450
|
-
let user = this.store.peekRecord('user', 1);
|
|
450
|
+
let user = this.store.peekRecord('user', '1');
|
|
451
451
|
store.createRecord('post', {
|
|
452
452
|
title: 'Ember is awesome!',
|
|
453
453
|
user: user
|
|
@@ -488,7 +488,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
488
488
|
Example
|
|
489
489
|
|
|
490
490
|
```javascript
|
|
491
|
-
store.findRecord('post', 1).then(function(post) {
|
|
491
|
+
store.findRecord('post', '1').then(function(post) {
|
|
492
492
|
store.unloadRecord(post);
|
|
493
493
|
});
|
|
494
494
|
```
|
|
@@ -626,8 +626,8 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
626
626
|
If you have access to the post model you can also pass the model itself to preload:
|
|
627
627
|
|
|
628
628
|
```javascript
|
|
629
|
-
let post = await store.findRecord('post', 1);
|
|
630
|
-
let comment = await store.findRecord('comment', 2, { post: myPostModel });
|
|
629
|
+
let post = await store.findRecord('post', '1');
|
|
630
|
+
let comment = await store.findRecord('comment', '2', { post: myPostModel });
|
|
631
631
|
```
|
|
632
632
|
|
|
633
633
|
### Reloading
|
|
@@ -656,7 +656,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
656
656
|
// revision: 2
|
|
657
657
|
// }
|
|
658
658
|
// ]
|
|
659
|
-
store.findRecord('post', 1, { reload: true }).then(function(post) {
|
|
659
|
+
store.findRecord('post', '1', { reload: true }).then(function(post) {
|
|
660
660
|
post.revision; // 2
|
|
661
661
|
});
|
|
662
662
|
```
|
|
@@ -694,7 +694,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
694
694
|
}
|
|
695
695
|
});
|
|
696
696
|
|
|
697
|
-
let blogPost = store.findRecord('post', 1).then(function(post) {
|
|
697
|
+
let blogPost = store.findRecord('post', '1').then(function(post) {
|
|
698
698
|
post.revision; // 1
|
|
699
699
|
});
|
|
700
700
|
|
|
@@ -879,7 +879,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
879
879
|
Example
|
|
880
880
|
|
|
881
881
|
```javascript
|
|
882
|
-
let userRef = store.getReference('user', 1);
|
|
882
|
+
let userRef = store.getReference('user', '1');
|
|
883
883
|
|
|
884
884
|
// check if the user is loaded
|
|
885
885
|
let isLoaded = userRef.value() !== null;
|
|
@@ -926,9 +926,9 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
926
926
|
**Example 1**
|
|
927
927
|
|
|
928
928
|
```js
|
|
929
|
-
let post = store.peekRecord('post', 1);
|
|
929
|
+
let post = store.peekRecord('post', '1');
|
|
930
930
|
|
|
931
|
-
post.id; // 1
|
|
931
|
+
post.id; // '1'
|
|
932
932
|
```
|
|
933
933
|
|
|
934
934
|
`peekRecord` can be called with a single identifier argument instead of the combination
|
|
@@ -939,7 +939,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
939
939
|
|
|
940
940
|
```js
|
|
941
941
|
let post = store.peekRecord({ type: 'post', id });
|
|
942
|
-
post.id; // 1
|
|
942
|
+
post.id; // '1'
|
|
943
943
|
```
|
|
944
944
|
|
|
945
945
|
If you have previously received an lid from an Identifier for this record, you can lookup the record again using
|
|
@@ -949,7 +949,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
949
949
|
|
|
950
950
|
```js
|
|
951
951
|
let post = store.peekRecord({ lid });
|
|
952
|
-
post.id; // 1
|
|
952
|
+
post.id; // '1'
|
|
953
953
|
```
|
|
954
954
|
|
|
955
955
|
|
|
@@ -991,7 +991,7 @@ declare module '@ember-data/store/-private/store-service' {
|
|
|
991
991
|
If you do something like this:
|
|
992
992
|
|
|
993
993
|
```javascript
|
|
994
|
-
store.query('person', { ids: [1, 2, 3] });
|
|
994
|
+
store.query('person', { ids: ['1', '2', '3'] });
|
|
995
995
|
```
|
|
996
996
|
|
|
997
997
|
The request made to the server will look something like this:
|