StatefulTests.ts
25 lines
| 461 B
| video/mp2t
|
TypeScriptLexer
cin
|
r2 | import * as Stateful from "dojo/Stateful"; | |
import { StatefulAttrs, watch } from "./traits"; | |||
cin
|
r0 | ||
interface ScheduleAttrs { | |||
title: string; | |||
duration: number; | |||
} | |||
declare class Schedule extends Stateful<ScheduleAttrs> { | |||
title: string; | |||
} | |||
const model = new Schedule({duration: 10, title: "Test event"}); | |||
model.get("title"); | |||
model.get("duration"); | |||
cin
|
r2 | model.set("duration", 12); | |
watch(model, "duration", v => v); | |||
declare const o : StatefulAttrs<Schedule>; |