Quantcast
Viewing all articles
Browse latest Browse all 4826

How can I find records by id and don't always make a network request

@tschoartschi wrote:

Hello!

I'm searching a solution for the following problem:

I get the IDs of a model from an external context. Then I use Ember Data to retrieve records from our backend base on the IDs which I got before. Therefore I use this.get('store').query('material', {ids: [1,2,3,4...] }) but query is not cached by Ember Data. So the network request is made over and over again. I would need something like findRecords or findRecordsById. I searched through the API and I found that there is a private method named findByIds (for details click here). But there are two gotchas:

  • I don't want to use a private API
  • findByIds seems to ignore coalesceFindRequests: true

What is the best way to solve this? Do I have to write this functionality on my own or is there already somewhere a implementation?

Thanks for every tip and hint Bye

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles