()
| 17 | const TODOS_FILE = 'todos.json' |
| 18 | |
| 19 | async function readTodos() { |
| 20 | return JSON.parse( |
| 21 | await fs.promises.readFile(TODOS_FILE, 'utf-8').catch(() => |
| 22 | JSON.stringify( |
| 23 | [ |
| 24 | { id: 1, name: 'Get groceries' }, |
| 25 | { id: 2, name: 'Buy a new phone' }, |
| 26 | ], |
| 27 | null, |
| 28 | 2, |
| 29 | ), |
| 30 | ), |
| 31 | ) |
| 32 | } |
| 33 | |
| 34 | const getTodos = createServerFn({ |
| 35 | method: 'GET', |
no outgoing calls
no test coverage detected