Don Olmstead
2015-12-18 22:01:31 UTC
I often use mixins to do behaviors in Polymer. What I'm wondering is if
there's a particular style I should use when doing their declarations when
I'm expecting them to be mixed in with a certain type.
As an example I have code like
abstract class MyBehavior {
html.CustomEvent fire(String type, {detail, bool canBubble: true, bool
cancelable: true, html.Node node});
void doSomething() {
fire('my-behavior-event');
}
}
Should the mixin be declared as instead?
abstract class MyBehavior implements PolymerElement {
void doSomething() {
fire('my-behavior-event');
}
}
The later saves some typing and makes things clearer on what it needs to be
mixed in with, but I wasn't sure if there was a preference either way.
there's a particular style I should use when doing their declarations when
I'm expecting them to be mixed in with a certain type.
As an example I have code like
abstract class MyBehavior {
html.CustomEvent fire(String type, {detail, bool canBubble: true, bool
cancelable: true, html.Node node});
void doSomething() {
fire('my-behavior-event');
}
}
Should the mixin be declared as instead?
abstract class MyBehavior implements PolymerElement {
void doSomething() {
fire('my-behavior-event');
}
}
The later saves some typing and makes things clearer on what it needs to be
mixed in with, but I wasn't sure if there was a preference either way.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.