@kenips wrote:
Hi all,
I have a route that makes a query so I'm getting back a PromiseArray in my model hook. I would like to bypass the sync. wait. Just wondering which approach is now better:
Traditional approach of setting up
loading
anderror
substate template, so that they appear async. This however needs duplication of template code since I'd like to the page to look like loaded except for a specific region.Wrap the model hook return in an object
{ promise: this.store.query(...) }
and set it up manually insetupController
(controller.set('model', model.promise)
). Then leverageisPending
andisFulfilled
in the template to display state. I prefer this since I have less template code duplication.My question is, am I going off track with 2?
Posts: 2
Participants: 2