Is there a method for querying locally accessible objects with ember-data?

I created a model that is localized on the client when initializing the application.

The findQuery method always executes an ajax request, for example:

 App.store.find(App.Person, {name: 'John'}) 

even when a App.Person with name:John already loaded. The find method, which accepts an identifier, first looks at local storage. But I need to be able to fulfill attribute requests.

My question is whether there is a method for executing queries strictly on locally available data .

+4
source share
1 answer

Use the DS.Store#filter method. A basic example is shown in README at https://github.com/emberjs/data , section Filtering Loaded Records .

+7
source

Source: https://habr.com/ru/post/1397654/


All Articles