import { djbase, djclass } from "@implab/djx/declare"; import { DjxWidgetBase } from "@implab/djx/tsx/DjxWidgetBase"; import { createElement, watch } from "@implab/djx/tsx"; import ProgressBar from "./ProgressBar"; import Button = require("dijit/form/Button"); const ref = (target: W, name: K) => (v: W[K]) => target.set(name, v); @djclass export default class MainWidget extends djbase(DjxWidgetBase) { titleNode?: HTMLHeadingElement; progressBar?: ProgressBar; count = 0; showCounter = false; render() { return

Hi!

{watch(this, "showCounter", flag => flag &&
)}
; } postCreate(): void { super.postCreate(); const inc = () => { this.set("count", this.count + 1); this.defer(inc, 1000); } inc(); } private _onToggleCounterClick = () => { this.set("showCounter", !this.showCounter); } }