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

Function createTransaction

packages/offline-transactions/tests/KeyScheduler.test.ts:5–28  ·  view source on GitHub ↗
({
  id,
  createdAt,
  nextAttemptAt,
  retryCount = 0,
}: {
  id: string
  createdAt: Date
  nextAttemptAt: number
  retryCount?: number
})

Source from the content-addressed store, hash-verified

3import type { OfflineTransaction } from '../src/types'
4
5function createTransaction({
6 id,
7 createdAt,
8 nextAttemptAt,
9 retryCount = 0,
10}: {
11 id: string
12 createdAt: Date
13 nextAttemptAt: number
14 retryCount?: number
15}): OfflineTransaction {
16 return {
17 id,
18 mutationFnName: `syncData`,
19 mutations: [],
20 keys: [],
21 idempotencyKey: `idempotency-${id}`,
22 createdAt,
23 retryCount,
24 nextAttemptAt,
25 metadata: {},
26 version: 1,
27 }
28}
29
30describe(`KeyScheduler`, () => {
31 afterEach(() => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected