Open History to see the last commit
1export interface Todo {
2 id: string
3 text: string
4 createdAt: number
5}
6β
7export const todos: Array<Todo> = [
8 {
9 id: crypto.randomUUID(),
10 text: 'Buy groceries',
11 createdAt: Date.now() - 3000,
12 },
13 {
14 id: crypto.randomUUID(),
15 text: 'Walk the dog',
16 createdAt: Date.now() - 2000,
17 },
18 {
19 id: crypto.randomUUID(),
20 text: 'Read a book',
21 createdAt: Date.now() - 1000,
22 },
23]
24β
25export async function getTodos(): Promise<Array<Todo>> {
26 await new Promise((resolve) => setTimeout(resolve, 200))
27 return todos
28}