StoreTests.ts
26 lines
| 531 B
| video/mp2t
|
TypeScriptLexer
cin
|
r2 | import * as Memory from "dojo/store/Memory"; | ||
import * as Observable from "dojo/store/Observable"; | ||||
cin
|
r0 | |||
interface Schedule { | ||||
cin
|
r1 | id?: string; | ||
cin
|
r0 | |||
title: string; | ||||
duration: number; | ||||
} | ||||
declare const store: dojo.store.api.Store<Schedule>; | ||||
const observable = new Observable(store); | ||||
cin
|
r1 | const mem = new Memory<Schedule>(); | ||
cin
|
r2 | observable.query().observe(() => { }); | ||
store.query().forEach(() => { }); | ||||
const total = await store.query().total; | ||||
const result = await store.query(); | ||||
cin
|
r1 | |||
cin
|
r2 | mem.query(); | ||
cin
|
r1 | |||
cin
|
r2 | mem.add({ duration: 10, title: "Test event" }); | ||