Get notified when findAll() background request is finished

Hi,

I like the idea of caching data but I have a problem and I didn’t find an adequate response.

I use findAll() to get my model, but when data is present in the store (from the second load), I got the stored model. It’s nice because the UI is rendered very fast but if the model loaded from the backend is different (for example if a record has been created), the model is outdated. findAll() always do a background request but there is no-way to be notified. Somebody has a way to get notified ?

If findAll is called and there is already records, it returns a RecordArray. You can check the isUpdating and isLoaded properties on the record array to check the loading state.

You can configure how findAll behaves with adapter settings, or manually on each call to findAll. Check the docs