Async BelongsTo should return a DS.PromiseObject #1314

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
  1. While traversing aync relationships:
post.get('author') // this belongsTo returns an Ember.RSVP.Promise
post.get('comments') // this hasMany returns a DS.PromiseArray

Currently, an asyncBelongsTo relationship returns a regular Promise. I believe that it should be return a DS.PromiseObject instead so that the value returned may also serve as a proxy for the related object. This pull request changes the behavoir of asyncBelongsTo so that it returns a DS.PromiseObject instead of a Promise.

  1. For various find requests:
store.find('post', 1) // returns a DS.PromiseObject
store.findAll('post') // returns a DS.PromiseArray
store.findMany('post', [1,2,3]) // returns a DS.ManyArray
store.findQuery('post', { ... }) // returns a DS.PromiseArray

All find requests, except findMany, currently return a thenable proxy. Is there any reason findMany can't also return a DS.PromiseArray? This pull request does not address this but I thought it related to my first comment above, so I wanted some feedback... I think it could be easily incorporated into this pull request.

👍

This is crucial - anything I can do to help get this merged sooner?

Owner

wycats commented Sep 18, 2013

Dup of #1320

wycats closed this Sep 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment