Skip to content

v0.15.0

Compare
Choose a tag to compare
@ryanto ryanto released this 16 Mar 16:31
· 387 commits to master since this release

Breaking changes

loadAll has been renamed to loadRecords.

store.loadAll is now store.loadRecords. loadAll is deprecated, but will continue to work until we release version 1.0.0.

The naming of loadAll was too close to findAll, by renaming the function loadRecords it is clear that this is not a 1-to-1 substitute for findAll.

store.findAll will load all records as well as return a live binding to all records in the store. This mean that as new models are created, or loaded from elsewhere, they will appear in the list returned by findAll.

Similarly, store.loadRecords will also load all records. However, it will not return a live binding to the store. This means that any records created, or loaded from elsewhere, will not appear in this list returned from loadRecords.

Upgrading from 0.14

Storefront users who want to upgrade from 0.14 will need to update any calls to loadAll in their code to loadRecords.

  model() {
-   return this.get('store').loadAll('post');
+   return this.get('store').loadRecords('post');
  }

That's it! You're all set.

Matching findAll's behavior

Storefront users who wish to match Ember Data's findAll behavior should use loadRecords to load data and store.peekAll to access data.

  async model() {
-   return this.get('store').findAll('post');
+   await this.get('store').loadRecords('post');
+   return this.get('store').peekAll('post');
  }

Since peekAll will return a live binding to the store this route retains that same behavior as findAll.