Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Using PromiseArrayMixin states VS route loading states

$
0
0

@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:

  1. Traditional approach of setting up loading and error 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.

  2. Wrap the model hook return in an object { promise: this.store.query(...) } and set it up manually in setupController (controller.set('model', model.promise)). Then leverage isPending and isFulfilled 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

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles