basic nodes

This commit is contained in:
Tobe O 2019-03-23 12:58:43 -04:00
parent 1a5937229e
commit 4cbfd3c251
6 changed files with 42 additions and 2 deletions

View file

@ -1 +1,5 @@
export 'src/builder_node.dart';
export 'src/component.dart';
export 'src/dom_builder.dart';
export 'src/dom_node.dart';
export 'src/fn.dart';

View file

@ -0,0 +1,8 @@
import 'dom_builder.dart';
import 'dom_node.dart';
abstract class BuilderNode extends DomNode {
DomBuilderElement<T> build<T>(DomBuilder<T> dom);
void destroy<T>(DomBuilderElement<T> el);
}

View file

@ -0,0 +1,15 @@
import 'dom_node.dart';
abstract class Component<State> {
State state;
DomNode render();
void afterMount() {}
void beforeDestroy() {}
void setState(State newState) {
// TODO:
}
}

View file

@ -0,0 +1,3 @@
abstract class DomNode {
}

10
jael_web/lib/src/fn.dart Normal file
View file

@ -0,0 +1,10 @@
// TODO: Lambda/anonymous component
//
// import 'component.dart';
// import 'dom_node.dart';
// class Fn<T> extends Component {
// final DomNode Function(T) f;
// Fn(this.f);
// }