Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

data.ts

26 lines547 Bytes

1import type { Todo } from '../../../services/todos/types'
2​
3export type { Todo }
4​
5export const todos: Array<Todo> = [
6 {
7 id: crypto.randomUUID(),
8 text: 'Buy groceries',
9 createdAt: Date.now() - 3000,
10 },
11 {
12 id: crypto.randomUUID(),
13 text: 'Walk the dog',
14 createdAt: Date.now() - 2000,
15 },
16 {
17 id: crypto.randomUUID(),
18 text: 'Read a book',
19 createdAt: Date.now() - 1000,
20 },
22​
23export async function getTodos(): Promise<Array<Todo>> {
24 await new Promise((resolve) => setTimeout(resolve, 200))
25 return todos