queryParams (query-params-new), refreshModel and RSVP


#1

On a route I am using query-params-new and have some actions on the controller that update the query params. I am also using Ember.RSVP for the model to resolve multiple models.

Is it possible to only refresh one of the resolves on RSVP instead of all of them? I’m guessing I’ll have to do something custom to update the model.

model: function(params) {
  return Ember.RSVP({
    events: this.store.find('event', {date: params.date}),
    announcements: this.store.find('announcement')
  });
}
queryParams: {
  date: {refreshModel: true}
}

#2

No, you’ll probably have to add some extra logic to cache the old value, which you can do just by storing it on the route instance, and then in the deactivate hook, which gets called when you leave the route, you can reset it so that next time you enter it resolves both values.