-
-
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
[PERF] optimise notifications when has-many array is changed #4583
Changes from 1 commit
0eeff74
4be1c97
fd60d3e
2625282
3674dca
9577e58
6b71d77
cdbaf87
27e2f11
b199170
8fe3411
993dd60
df30a5f
6e67c3d
e8c2c86
90dbc65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ node_modules/ | |
bower_components/ | ||
.metadata_never_index | ||
npm-debug.log | ||
.vscodeignore | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,19 @@ import {module, test} from 'qunit'; | |
|
||
import DS from 'ember-data'; | ||
|
||
var env, store, Person; | ||
var attr = DS.attr; | ||
var hasMany = DS.hasMany; | ||
var run = Ember.run; | ||
var env, store; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let |
||
const attr = DS.attr; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
const hasMany = DS.hasMany; | ||
const run = Ember.run; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
const Person = DS.Model.extend({ | ||
firstName: attr('string'), | ||
lastName: attr('string'), | ||
siblings: hasMany('person') | ||
}); | ||
|
||
module('integration/records/relationship-changes - Relationship changes', { | ||
beforeEach() { | ||
Person = DS.Model.extend({ | ||
firstName: attr('string'), | ||
lastName: attr('string'), | ||
siblings: hasMany('person') | ||
}); | ||
|
||
env = setupStore({ | ||
person: Person | ||
}); | ||
|
@@ -33,8 +33,8 @@ module('integration/records/relationship-changes - Relationship changes', { | |
|
||
test('Calling push with relationship triggers observers once if the relationship was empty and is added to', function(assert) { | ||
assert.expect(1); | ||
var person; | ||
var observerCount = 0; | ||
let person = null; | ||
let observerCount = 0; | ||
|
||
run(function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
store.push({ | ||
|
@@ -92,8 +92,8 @@ test('Calling push with relationship triggers observers once if the relationship | |
|
||
test('Calling push with relationship triggers observers once if the relationship was not empty and was added to', function(assert) { | ||
assert.expect(1); | ||
var person; | ||
var observerCount = 0; | ||
let person = null; | ||
let observerCount = 0; | ||
|
||
run(function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
store.push({ | ||
|
@@ -169,8 +169,8 @@ test('Calling push with relationship triggers observers once if the relationship | |
|
||
test('Calling push with relationship triggers observers once if the relationship was made shorter', function(assert) { | ||
assert.expect(1); | ||
var person; | ||
var observerCount = 0; | ||
let person = null; | ||
let observerCount = 0; | ||
|
||
run(function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
store.push({ | ||
|
@@ -229,8 +229,8 @@ test('Calling push with relationship triggers observers once if the relationship | |
|
||
test('Calling push with relationship triggers observers once if the relationship was reordered', function(assert) { | ||
assert.expect(1); | ||
var person; | ||
var observerCount = 0; | ||
let person = null; | ||
let observerCount = 0; | ||
|
||
run(function() { | ||
store.push({ | ||
|
@@ -298,8 +298,8 @@ test('Calling push with relationship triggers observers once if the relationship | |
|
||
test('Calling push with relationship does not trigger observers if the relationship was not changed', function(assert) { | ||
assert.expect(1); | ||
var person; | ||
var observerCount = 0; | ||
let person = null; | ||
let observerCount = 0; | ||
|
||
run(function() { | ||
store.push({ | ||
|
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.
unsure if this should be added here, typically editor specific things are not included.
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.
please remove