vasille
Version:
The first Developer eXperience Orientated front-end framework (core library).
22 lines (21 loc) • 513 B
JavaScript
import { Fragment } from "./node.js";
/**
* Watch Node
* @class Watch
* @extends Fragment
*/
export class Watch extends Fragment {
constructor(input, runner) {
super(input, runner, ":watch");
}
compose() {
this.watch(value => {
this.children.forEach(child => {
child.destroy();
});
this.children.clear();
this.lastChild = undefined;
this.input.slot?.(this, value);
}, [this.input.model]);
}
}