MCPcopy Index your code
hub / github.com/TanStack/db / constructor

Method constructor

packages/db/src/transactions.ts:224–237  ·  view source on GitHub ↗
(config: TransactionConfig<T>)

Source from the content-addressed store, hash-verified

222 }
223
224 constructor(config: TransactionConfig<T>) {
225 if (typeof config.mutationFn === `undefined`) {
226 throw new MissingMutationFunctionError()
227 }
228 this.id = config.id ?? safeRandomUUID()
229 this.mutationFn = config.mutationFn
230 this.state = `pending`
231 this.mutations = []
232 this.isPersisted = createDeferred<Transaction<T>>()
233 this.autoCommit = config.autoCommit ?? true
234 this.createdAt = new Date()
235 this.sequenceNumber = sequenceNumber++
236 this.metadata = config.metadata ?? {}
237 }
238
239 setState(newState: TransactionState) {
240 this.state = newState

Callers

nothing calls this directly

Calls 2

safeRandomUUIDFunction · 0.90
createDeferredFunction · 0.90

Tested by

no test coverage detected