Skip to content
Permalink
Browse files

feature: SimpleDataStoreMixin sends a PropertyChangedAction

  • Loading branch information...
MikeMitterer committed Nov 21, 2018
1 parent 2286622 commit d74c7386eeeaaf6c66aa5cea56c8d634d604c3aa
Showing with 21 additions and 1 deletion.
  1. +17 −0 lib/directive/components/interfaces/actions.dart
  2. +4 −1 lib/m4d_directive.dart
@@ -0,0 +1,17 @@
library m4d_directives.components.actions;

import 'package:m4d_flux/m4d_flux.dart';

// - Actions sent by our app -------------------------------------------------------------------------------------------

class ListChangedAction extends Action {
static const ActionName NAME = const ActionName("m4d_directives.components.actions.ListChangedAction");
const ListChangedAction() : super(ActionType.Signal, NAME);
}

class PropertyChangedAction extends DataAction<String> {
static const ActionName NAME = const ActionName("m4d_directives.components.actions.PropertyChangedAction");
const PropertyChangedAction(final String propertyName) : super(NAME,propertyName);
}


@@ -44,6 +44,8 @@ import 'package:m4d_flux/m4d_flux.dart';
export 'package:m4d_flux/m4d_flux.dart';

import 'directive/components/interfaces/stores.dart';
import 'directive/components/interfaces/actions.dart';

import 'services.dart' as service;

part "directive/components/MaterialClass.dart";
@@ -81,7 +83,7 @@ abstract class SimpleDataStoreMixin implements SimpleValueStore {
bindings[varname] = ObservableProperty<T>(initWith, formatter: formatter);
bindings[varname].onChange.listen((_) {
_logger.fine("$varname changed to ${bindings[varname].value}...");
emitChange();
emitChange(action: PropertyChangedAction(varname));
});
}

@@ -91,6 +93,7 @@ abstract class SimpleDataStoreMixin implements SimpleValueStore {

return bindings[varname];
}

}

/// Default implementation for SimpleValueStore

0 comments on commit d74c738

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