Skip to content

Commit b9a170f

Browse files
committed
refactor(dccd): Updated to not depend on running the smoke transformer
1 parent 169eaae commit b9a170f

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

lib/change_detection/dirty_checking_change_detector.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'dart:collection';
44
import 'package:angular/change_detection/change_detection.dart';
55
import 'dart:async';
66
import 'package:observe/observe.dart' as obs;
7-
import 'package:smoke/smoke.dart' as smoke;
87

98
/**
109
* [DirtyCheckingChangeDetector] determines which object properties have changed
@@ -567,15 +566,11 @@ class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
567566
// no-op if closure (see _MODE_GETTER_OR_METHOD_CLOSURE_) or until the next notification
568567
_mode = _MODE_NOOP_;
569568
if (current is! Function || identical(current, _getter(object))) {
570-
var subscription = (object as obs.ChangeNotifier).changes.listen((records) {
571-
for (var rec in records) {
572-
// todo(vicb) Change to String if dartbug.com/17863 eventually gets fixed
573-
if (smoke.symbolToName(rec.name) == field) {
574-
// Run the dccd after the observed `object.field` is updated
575-
_mode = _MODE_GETTER_NOTIFIED_;
576-
break;
577-
}
578-
}
569+
var subscription = (object as obs.Observable).changes.listen((records) {
570+
// todo(vicb) we should only go to the _MODE_GETTER_NOTIFIED_ mode when a record
571+
// is applicable to the current `field`. With the current implementation, any field
572+
// on an observable object will trigger this listener.
573+
_mode = _MODE_GETTER_NOTIFIED_;
579574
});
580575
_group._registerObservable(this, subscription);
581576
}

0 commit comments

Comments
 (0)