Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable has many promise proxy #4842

Merged
merged 2 commits into from
Mar 8, 2017
Merged

Conversation

stefanpenner
Copy link
Member

@stefanpenner stefanpenner commented Mar 8, 2017

@stefanpenner
Copy link
Member Author

stefanpenner commented Mar 8, 2017

cc @BryanCrotaz @hjdivad @runspired

}
this.__loadingPromise.set('promise', promise)
} else {
this.__loadingPromise = new PromiseManyArray({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call PromiseManyArray.create() or new PromiseManyArray() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either should be fine

content.reload = () => Ember.RSVP.Promise.resolve(content);
let promise = Ember.RSVP.Promise.resolve(content);

let array = DS.PromiseManyArray.create({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like above

this.__loadingPromise = null;
}

get _loadingPromise() { return this.__loadingPromise; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have both _loadingPromise and __loadingPromise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to make sure it was readOnly without going through the update method. (So people don't accidentally bypass)

const Person = DS.Model.extend({
name: DS.attr('string'),
tag: DS.belongsTo('tag', { async: false })
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding toStrings on these makes debugging a lot nicer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update all of them in a later PR

@stefanpenner stefanpenner force-pushed the stable-has-many-promise-proxy branch from a1b0c41 to bf7006d Compare March 8, 2017 16:11
@stefanpenner stefanpenner force-pushed the stable-has-many-promise-proxy branch from bf7006d to 6c601ce Compare March 8, 2017 17:33
@stefanpenner stefanpenner merged commit 904e412 into master Mar 8, 2017
@stefanpenner stefanpenner deleted the stable-has-many-promise-proxy branch March 8, 2017 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants