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

[PERF] optimise notifications when has-many array is changed #4583

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ node_modules/
bower_components/
.metadata_never_index
npm-debug.log
.vscodeignore
Copy link
Member

@stefanpenner stefanpenner Oct 21, 2016

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.

Copy link
Member

Choose a reason for hiding this comment

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

please remove

40 changes: 20 additions & 20 deletions tests/integration/records/relationship-changes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

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

let

const attr = DS.attr;
Copy link
Member

Choose a reason for hiding this comment

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

const { attr, hasMany} = DS

const hasMany = DS.hasMany;
const run = Ember.run;
Copy link
Member

Choose a reason for hiding this comment

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

const { run } = Ember


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
});
Expand All @@ -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() {
Copy link
Member

Choose a reason for hiding this comment

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

=>

store.push({
Expand Down Expand Up @@ -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() {
Copy link
Member

Choose a reason for hiding this comment

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

=>

store.push({
Expand Down Expand Up @@ -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() {
Copy link
Member

Choose a reason for hiding this comment

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

=>

store.push({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down