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

Function createTodos

packages/query-db-collection/tests/query.test.ts:2436–2445  ·  view source on GitHub ↗
(newTodos: Array<Todo>)

Source from the content-addressed store, hash-verified

2434 }
2435
2436 async function createTodos(newTodos: Array<Todo>) {
2437 await sleep(50)
2438 const savedTodos = newTodos.map((todo) => ({
2439 ...todo,
2440 id: nextServerId++,
2441 createdAt: new Date().toISOString(),
2442 }))
2443 serverTodos.push(...savedTodos)
2444 return savedTodos
2445 }
2446
2447 const todosCollection = createCollection(
2448 queryCollectionOptions<Todo>({

Callers 1

query.test.tsFile · 0.70

Calls 2

sleepFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected