Skip to content

Stable has many promise proxy - #4842

Merged
stefanpenner merged 2 commits into
masterfrom
stable-has-many-promise-proxy
Mar 8, 2017
Merged

Stable has many promise proxy#4842
stefanpenner merged 2 commits into
masterfrom
stable-has-many-promise-proxy

Conversation

@stefanpenner

@stefanpenner stefanpenner commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

@stefanpenner

stefanpenner commented Mar 8, 2017

Copy link
Copy Markdown
Contributor Author

cc @BryanCrotaz @hjdivad @runspired

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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

Comment thread tests/unit/promise-proxies-test.js Outdated
content.reload = () => Ember.RSVP.Promise.resolve(content);
let promise = Ember.RSVP.Promise.resolve(content);

let array = DS.PromiseManyArray.create({

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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.

4 participants