Skip to content

Commit ed846b5

Browse files
committed
Remove property change methods from EmberObject
1 parent 414bdec commit ed846b5

File tree

3 files changed

+2
-66
lines changed

3 files changed

+2
-66
lines changed

packages/@ember/object/index.ts

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import {
44
isElementDescriptor,
55
setClassicDecorator,
66
hasListeners,
7-
beginPropertyChanges,
8-
notifyPropertyChange,
9-
endPropertyChanges,
107
addObserver,
118
removeObserver,
129
get,
@@ -43,65 +40,6 @@ type ObserverMethod<Target, Sender> =
4340
@public
4441
*/
4542
class EmberObject extends CoreObject {
46-
/**
47-
Begins a grouping of property changes.
48-
49-
You can use this method to group property changes so that notifications
50-
will not be sent until the changes are finished. If you plan to make a
51-
large number of changes to an object at one time, you should call this
52-
method at the beginning of the changes to begin deferring change
53-
notifications. When you are done making changes, call
54-
`endPropertyChanges()` to deliver the deferred change notifications and end
55-
deferring.
56-
57-
@method beginPropertyChanges
58-
@return {Observable}
59-
@private
60-
*/
61-
beginPropertyChanges() {
62-
beginPropertyChanges();
63-
return this;
64-
}
65-
66-
/**
67-
Ends a grouping of property changes.
68-
69-
You can use this method to group property changes so that notifications
70-
will not be sent until the changes are finished. If you plan to make a
71-
large number of changes to an object at one time, you should call
72-
`beginPropertyChanges()` at the beginning of the changes to defer change
73-
notifications. When you are done making changes, call this method to
74-
deliver the deferred change notifications and end deferring.
75-
76-
@method endPropertyChanges
77-
@return {Observable}
78-
@private
79-
*/
80-
endPropertyChanges() {
81-
endPropertyChanges();
82-
return this;
83-
}
84-
/**
85-
Convenience method to call `propertyWillChange` and `propertyDidChange` in
86-
succession.
87-
88-
Notify the observer system that a property has just changed.
89-
90-
Sometimes you need to change a value directly or indirectly without
91-
actually calling `get()` or `set()` on it. In this case, you can use this
92-
method instead. Calling this method will notify all observers that the
93-
property has potentially changed value.
94-
95-
@method notifyPropertyChange
96-
@param {String} keyName The property key to be notified about.
97-
@return {Observable}
98-
@public
99-
*/
100-
notifyPropertyChange(keyName: string) {
101-
notifyPropertyChange(this, keyName);
102-
return this;
103-
}
104-
10543
/**
10644
Adds an observer on a property.
10745

packages/@ember/object/type-tests/ember-object.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ expectTypeOf(p.toggleProperty('age')).toEqualTypeOf<boolean>();
5151

5252
expectTypeOf(p.cacheFor('age')).toEqualTypeOf<unknown>();
5353

54-
expectTypeOf(p.notifyPropertyChange('firstName')).toEqualTypeOf(p);
55-
5654
const p2 = Person.create({ firstName: 'string' });
5755
expectTypeOf(p2.firstName).toEqualTypeOf<string>();
5856

packages/@ember/routing/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { privatize as P } from '@ember/-internals/container';
22
import type { BootEnvironment, OutletState, OutletView } from '@ember/-internals/glimmer';
3-
import { sendEvent } from '@ember/-internals/metal';
43
import { computed, get, set } from '@ember/object';
4+
import { notifyPropertyChange, sendEvent } from '@ember/-internals/metal';
55
import type { default as Owner, FactoryManager } from '@ember/owner';
66
import { getOwner } from '@ember/owner';
77
import { default as BucketCache } from './lib/cache';
@@ -60,7 +60,7 @@ function defaultDidTransition(this: EmberRouter, infos: InternalRouteInfo<Route>
6060

6161
this._cancelSlowTransitionTimer();
6262

63-
this.notifyPropertyChange('url');
63+
notifyPropertyChange(this, 'url');
6464
set(this, 'currentState', this.targetState);
6565

6666
if (DEBUG) {

0 commit comments

Comments
 (0)