Skip to content
Permalink
Browse files

doc: Better log-output for DefaultSimpleDataStore

  • Loading branch information...
MikeMitterer committed Nov 19, 2018
1 parent f0d20a5 commit acde27d842593a22d228edce09f87af3ea41d2f4
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/m4d_directive.dart
@@ -70,6 +70,8 @@ part "directive/utils.dart";
/// final store = ioc.IOCContainer().resolve(service.SimpleDataStore).as<MyDataStore>();
/// }
class DefaultSimpleDataStore extends Emitter implements SimpleValueStore {
final Logger _logger = new Logger('m4d_directive.DefaultSimpleDataStore');

@protected
final bindings = Map<String, ObservableProperty>();

@@ -90,8 +92,10 @@ class DefaultSimpleDataStore extends Emitter implements SimpleValueStore {

if(!bindings.containsKey(varname)) {
bindings[varname] = ObservableProperty<T>(initWith, formatter: formatter);
//print("$varname changed...");
bindings[varname].onChange.listen((_) => emitChange());
bindings[varname].onChange.listen((_) {
_logger.fine("$varname changed to ${bindings[varname].value}...");
emitChange();
});
}

if(formatter != null) {

0 comments on commit acde27d

Please sign in to comment.
You can’t perform that action at this time.