ChangeValueNotificationsMixin abstract class
abstract class ChangeValueNotificationsMixin implements ChangeNotificationsMixin {
Change _change;
Change _changeSync;
_clearChanges() {
_change = null;
}
_clearChangesSync() {
_changeSync = null;
}
_markChanged(dynamic oldValue, dynamic newValue) {
Change change = new Change(oldValue, newValue);
if(_changeSync == null) _changeSync = change.clone();
else _changeSync.mergeIn(change);
if(_change == null) _change = change.clone();
else _change.mergeIn(change);
}
void _dispose(){
_closeChangeStreams();
}
}
Implements
Properties
final Stream<dynamic> onBeforeAdd #
inherited from ChangeNotificationsMixin
Stream populated with DataMapView events before any data object is added.
Stream<dynamic> get onBeforeAdd {
if(_onBeforeAddedController == null) {
_onBeforeAddedController =
new StreamController.broadcast(sync: true);
}
return _onBeforeAddedController.stream;
}
final Stream<dynamic> onBeforeRemove #
inherited from ChangeNotificationsMixin
Stream populated with DataMapView events before any data object is removed.
Stream<dynamic> get onBeforeRemove {
if(_onBeforeRemovedController == null) {
_onBeforeRemovedController =
new StreamController.broadcast(sync: true);
}
return _onBeforeRemovedController.stream;
}
final Stream<ChangeSet> onChange #
inherited from ChangeNotificationsMixin
Stream populated with ChangeSet events whenever the collection or any of data object contained gets changed.
Stream<ChangeSet> get onChange {
if(_onChangeController == null) {
_onChangeController =
new StreamController.broadcast();
}
return _onChangeController.stream;
}
final Stream<Map> onChangeSync #
inherited from ChangeNotificationsMixin
Stream populated with {'change': ChangeSet, 'author': dynamic} events
synchronously at the moment when the collection or any data object contained
gets changed.
Stream<Map> get onChangeSync => _onChangeSyncController.stream;