Skip to content

Commit c362f33

Browse files
committed
style(Change Detection): rename WatchGroupDispatcher to ChangeDispatcher
1 parent 01fa90c commit c362f33

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

modules/benchmarks/src/change_detection/change_detection_benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {benchmark, benchmarkStep} from 'benchpress/benchpress';
88
import {
99
ChangeDetector,
1010
ProtoRecordRange,
11-
WatchGroupDispatcher,
11+
ChangeDispatcher,
1212
} from 'change_detection/change_detector';
1313

1414

@@ -180,7 +180,7 @@ export function main () {
180180
}
181181

182182

183-
class DummyDispatcher extends WatchGroupDispatcher {
183+
class DummyDispatcher extends ChangeDispatcher {
184184
onRecordChange(record, context) {
185185
}
186-
}
186+
}

modules/change_detection/src/record.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Record {
103103

104104
// Opaque data which will be the target of notification.
105105
// If the object is instance of Record, then it it is directly processed
106-
// Otherwise it is the context used by WatchGroupDispatcher.
106+
// Otherwise it is the context used by ChangeDispatcher.
107107
dest;
108108

109109
constructor(recordRange:RecordRange, protoRecord:ProtoRecord, formatters:Map) {

modules/change_detection/src/record_range.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ export class ProtoRecordRange {
4545
* Parses [ast] into [ProtoRecord]s and adds them to [ProtoRecordRange].
4646
*
4747
* @param ast The expression to watch
48-
* @param expressionMemento an opaque object which will be passed to WatchGroupDispatcher on
48+
* @param expressionMemento an opaque object which will be passed to ChangeDispatcher on
4949
* detecting a change.
50-
* @param content Wether to watch collection content (true) or reference (false, default)
50+
* @param groupMemento
51+
* @param content Whether to watch collection content (true) or reference (false, default)
5152
*/
5253
addRecordsFromAST(ast:AST,
5354
expressionMemento,
@@ -65,7 +66,7 @@ export class ProtoRecordRange {
6566
this.recordCreator.createRecordsFromAST(ast, expressionMemento, groupMemento);
6667
}
6768

68-
// TODO(rado): the type annotation should be dispatcher:WatchGroupDispatcher.
69+
// TODO(rado): the type annotation should be dispatcher:ChangeDispatcher.
6970
// but @Implements is not ready yet.
7071
instantiate(dispatcher, formatters:Map):RecordRange {
7172
var recordRange:RecordRange = new RecordRange(this, dispatcher);
@@ -98,11 +99,11 @@ export class ProtoRecordRange {
9899

99100
export class RecordRange {
100101
protoRecordRange:ProtoRecordRange;
101-
dispatcher:any; //WatchGroupDispatcher
102+
dispatcher:any; //ChangeDispatcher
102103
headRecord:Record;
103104
tailRecord:Record;
104105
disabled:boolean;
105-
// TODO(rado): the type annotation should be dispatcher:WatchGroupDispatcher.
106+
// TODO(rado): the type annotation should be dispatcher:ChangeDispatcher.
106107
// but @Implements is not ready yet.
107108
constructor(protoRecordRange:ProtoRecordRange, dispatcher) {
108109
this.protoRecordRange = protoRecordRange;
@@ -296,8 +297,7 @@ function _linkEnabled(a:Record, b:Record) {
296297
b.prevEnabled = a;
297298
}
298299

299-
export class WatchGroupDispatcher {
300-
// The record holds the previous value at the time of the call
300+
export class ChangeDispatcher {
301301
onRecordChange(record:Record, context) {}
302302
}
303303

modules/change_detection/test/change_detector_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
ChangeDetector,
1212
ProtoRecordRange,
1313
RecordRange,
14-
WatchGroupDispatcher,
14+
ChangeDispatcher,
1515
ProtoRecord
1616
} from 'change_detection/change_detector';
1717

@@ -480,7 +480,7 @@ class TestData {
480480
}
481481
}
482482

483-
class TestDispatcher extends WatchGroupDispatcher {
483+
class TestDispatcher extends ChangeDispatcher {
484484
log:List;
485485
loggedValues:List;
486486
onChange:Function;

modules/change_detection/test/record_range_spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
ChangeDetector,
1010
ProtoRecordRange,
1111
RecordRange,
12-
WatchGroupDispatcher,
1312
ProtoRecord
1413
} from 'change_detection/change_detector';
1514

modules/core/src/compiler/view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {DOM, Element, Node, Text, DocumentFragment, TemplateElement} from 'facade/dom';
22
import {ListWrapper, MapWrapper, StringMapWrapper, List} from 'facade/collection';
3-
import {ProtoRecordRange, RecordRange, WatchGroupDispatcher} from 'change_detection/record_range';
3+
import {ProtoRecordRange, RecordRange, ChangeDispatcher} from 'change_detection/record_range';
44
import {Record} from 'change_detection/record';
55
import {AST} from 'change_detection/parser/ast';
66

@@ -20,7 +20,7 @@ const NG_BINDING_CLASS = 'ng-binding';
2020
/**
2121
* Const of making objects: http://jsperf.com/instantiate-size-of-object
2222
*/
23-
@IMPLEMENTS(WatchGroupDispatcher)
23+
@IMPLEMENTS(ChangeDispatcher)
2424
export class View {
2525
/// This list matches the _nodes list. It is sparse, since only Elements have ElementInjector
2626
rootElementInjectors:List<ElementInjector>;

0 commit comments

Comments
 (0)