Hook for background reload?


#1

I’m using findAll() with the default background reloading behavior so when findAll() is called again, it’ll return the cached records immediately while fetching from the server again. Is there a hook or a way to tell when this background reloading is done?

My use case is that my API is quite slow, so when findAll() is called again, I don’t want to show a loading screen or no data while waiting for the API to return when I can just show the cached versions. However, I at least want to give an indication (perhaps a little spinning icon in the upper right) signifying data is being reloaded. So is it possible to track background reloading?


#2

May be you could try using isUpdating property from DS.RecordArray. Inside template, {{#if model.isUpdating}} Loading Icon {{/if}}