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

Function apiCreate

packages/query-db-collection/tests/query.test.ts:6454–6461  ·  view source on GitHub ↗
(
        item: Omit<Assignment, 'id'>,
      )

Source from the content-addressed store, hash-verified

6452 let nextId = 100
6453
6454 const apiCreate = async (
6455 item: Omit<Assignment, 'id'>,
6456 ): Promise<Assignment> => {
6457 await sleep(MUTATION_DELAY)
6458 const created = { ...item, id: nextId++ }
6459 serverItems.push(created)
6460 return created
6461 }
6462
6463 const apiDelete = async (id: number): Promise<void> => {
6464 await sleep(MUTATION_DELAY)

Callers 1

query.test.tsFile · 0.85

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected