-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX beta] Don't unnecessarily materialize records #4272
Conversation
|
||
if (inverseRecord && inverseRecord.isLoaded()) { | ||
return inverseRecord.getRecord(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This or #4271 needs to be updated, depending on which is merged first.
Looks good @pangratz. 👍 |
@igorT can you take a look at this PR and check if this is what you had in mind? |
@param {Object} data | ||
@return {DS.InternalModel|Array} pushed InternalModel(s) | ||
*/ | ||
_push(data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we name this to refer to internalModel somehow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Struggling to find a better name here, any suggestions? _shallowPush
or _lightweightPush
? Because _pushInternalModel
doesn't sound right to me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of making this a public method pushRef
or something, which returns RecordReference
(s)? I think @fivetanley you were mentioning something like that somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created RFC#161 to get a discussion on the store.pushRef
going...
This adds a `store#_push` method which returns DS.InternalModel's instead of materialized DS.Model instances. This allows us to defer the materialization process of an InternalModel until the corresponding record is actually needed.
👯♂️ |
This adds a
store#_push
method which returns DS.InternalModel'sinstead of materialized DS.Model instances. This allows us to defer the
materialization process of an InternalModel until the corresponding
record is actually needed.