Skip to content

Commit

Permalink
remove private API calls (changeProperties is mistakenly marked as pr…
Browse files Browse the repository at this point in the history
…ivate but is in fact public) (#5365)
  • Loading branch information
BryanCrotaz authored and bmac committed Feb 28, 2018
1 parent 2e1a112 commit 09f9c7e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions addon/-private/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import EmberObject, {
observer
} from '@ember/object';
import Map from '@ember/map';
import Ember from 'ember';
import { DEBUG } from '@glimmer/env';
import { assert, warn } from '@ember/debug';
import { PromiseObject } from "../promise-proxies";
Expand All @@ -21,6 +20,9 @@ import {
relationshipsDescriptor
} from '../relationships/ext';

import Ember from 'ember';
const { changeProperties } = Ember;

/**
@module ember-data
*/
Expand Down Expand Up @@ -635,13 +637,16 @@ const Model = EmberObject.extend(Evented, {
@private
*/
_notifyProperties(keys) {
Ember.beginPropertyChanges();
let key;
for (let i = 0, length = keys.length; i < length; i++) {
key = keys[i];
this.notifyPropertyChange(key);
}
Ember.endPropertyChanges();
// changeProperties defers notifications until after the delegate
// and protects with a try...finally block
// previously used begin...endPropertyChanges but this is private API
changeProperties(() => {
let key;
for (let i = 0, length = keys.length; i < length; i++) {
key = keys[i];
this.notifyPropertyChange(key);
}
});
},

/**
Expand Down

0 comments on commit 09f9c7e

Please sign in to comment.