-
-
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
Cleanup record array manager #4591
Conversation
95ae791
to
cfe32d3
Compare
* add tests * remove unused feature of passing in an optional index to insert at
* leave note for future work, e.g. the cleanup that is happening should likely not happen.
* recordArray.invoke(‘createSnapshot’) was previously invoked on the result of `internal.getRecord()` which no longer has createSnapshot, but `invoke` doesn’t error if a method isn’t found. * recordArray.snapshot is private, we should underscore it * add tests
* ensure filter function updates just before destroy are ignored * add unit test coverage for what makes filtered-record-arrays different then RecordArray
* add unit tests * fixup shape
31a957a
to
81cf11c
Compare
query: null, | ||
init() { | ||
this._super(...arguments); | ||
this.query = this.query || null; |
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.
Why the guard against existing on query and not on links
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 is due to links is state provided by internal loadRecords
, and not via the constructor
@@ -44,7 +48,7 @@ export default RecordArray.extend({ | |||
loadRecords(records, payload) { | |||
let token = heimdall.start('AdapterPopulatedRecordArray.loadRecords'); | |||
//TODO Optimize | |||
var internalModels = Ember.A(records).mapBy('_internalModel'); | |||
let internalModels = records.map(record => get(record, '_internalModel')); |
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.
is mapBy not that great?
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.
Ember.A()
is heavy weight, for merely doing somethingmap
+=>
can do.
d2ddd72
to
fb3a66f
Compare
* move to integration (as it is tests interaction between store/manager/array) * remove unit tests already covered by tests/unit/record-arrays/record-arrays-test * cleanup file
fb3a66f
to
4b5fa40
Compare
No description provided.