##// END OF EJS Templates
added type parameter to dojo.store.api.SortInformation,...
added type parameter to dojo.store.api.SortInformation, added sort function to query sort option

File last commit:

r20:1c7650c17856 v1.0.8 default
r20:1c7650c17856 v1.0.8 default
Show More
StoreTests.ts
27 lines | 693 B | video/mp2t | TypeScriptLexer
import * as Memory from "dojo/store/Memory";
import * as Observable from "dojo/store/Observable";
interface Schedule {
id?: string;
title: string;
duration: number;
}
declare const store: dojo.store.api.Store<Schedule>;
const observable = new Observable(store);
const mem = new Memory<Schedule>();
observable.query().observe(() => { });
store.query().forEach(() => { });
const total = await store.query().total;
const res1 = await store.query(undefined, { sort: [{ attribute: "duration", descending: true }] });
const res2 = await store.query(undefined, { sort: ({ duration: a }, { duration: b }) => a - b });
mem.query();
mem.add({ duration: 10, title: "Test event" });