jeudi 8 octobre 2015

Ember.js checking store before going to database in 2.0+

In Ember.js 2.0+, if I want to check the store to see if records are already loaded and only go back to the database if they are not loaded, what method should I use?

store.query('model', {'filter[ids]: ids}) goes back to the database every time

store.filter(...) I'm a little fuzzy from the documentation on what this does

Is there a built in function or do I need to check for the records using store.hasRecordForId('model', id) for all of the records I want to check for and then load from the store directly vs going back to the database?

Thanks!




Aucun commentaire:

Enregistrer un commentaire