MCPcopy Create free account
hub / github.com/TanStack/db / getAll

Function getAll

examples/react-native/offline-transactions/src/utils/api.ts:40–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38// API client that calls the shared backend server
39export const todoApi = {
40 async getAll(): Promise<Array<Todo>> {
41 const response = await fetch(`${BASE_URL}/api/todos`)
42 if (!response.ok) {
43 throw new Error(`Failed to fetch todos: ${response.status}`)
44 }
45 const data: Array<TodoResponse> = await response.json()
46 return data.map(parseTodo)
47 },
48
49 async create(data: {
50 id?: string

Callers

nothing calls this directly

Calls 2

fetchFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected