Skip to content

Commit

Permalink
Reducing more noise
Browse files Browse the repository at this point in the history
  • Loading branch information
pete committed Apr 29, 2019
1 parent 9e94535 commit 680298c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/store/addon/-private/system/deprecated-evented.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ if (DEBUG) {
return Evented.mixins[0].properties.has.call(this, name);
},

_on() {
return Evented.mixins[0].properties.on.call(this, ...arguments);
},

_deprecateEvented(eventName) {
let deprecations = lookupDeprecations(this);
const _deprecationData = this._getDeprecatedEventedInfo
Expand Down
17 changes: 12 additions & 5 deletions packages/store/addon/-private/system/model/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import DeprecatedEvent from '../deprecated-evented';
import ArrayProxy from '@ember/array/proxy';
import { get, computed } from '@ember/object';
import { makeArray, A } from '@ember/array';
import { DEBUG } from '@glimmer/env';

/**
@module ember-data
Expand Down Expand Up @@ -90,8 +91,8 @@ export default ArrayProxy.extend(DeprecatedEvent, {
@private
*/
_registerHandlers(target, becameInvalid, becameValid) {
this.on('becameInvalid', target, becameInvalid);
this.on('becameValid', target, becameValid);
this._on('becameInvalid', target, becameInvalid);
this._on('becameValid', target, becameValid);
},

/**
Expand Down Expand Up @@ -226,7 +227,9 @@ export default ArrayProxy.extend(DeprecatedEvent, {
this._add(attribute, messages);

if (wasEmpty && !get(this, 'isEmpty')) {
this.trigger('becameInvalid');
if (DEBUG && this._has('becameInvalid')) {
this.trigger('becameInvalid');
}
}
},

Expand Down Expand Up @@ -304,7 +307,9 @@ export default ArrayProxy.extend(DeprecatedEvent, {
this._remove(attribute);

if (get(this, 'isEmpty')) {
this.trigger('becameValid');
if (DEBUG && this._has('becameInvalid')) {
this.trigger('becameValid');
}
}
},

Expand Down Expand Up @@ -371,7 +376,9 @@ export default ArrayProxy.extend(DeprecatedEvent, {
}

this._clear();
this.trigger('becameValid');
if (DEBUG && this._has('becameInvalid')) {
this.trigger('becameValid');
}
},

/**
Expand Down

0 comments on commit 680298c

Please sign in to comment.