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

Function ensureContext

packages/query-db-collection/src/manual-sync.ts:235–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233 TInsertInput extends object = TRow,
234>(getContext: () => SyncContext<TRow, TKey> | null) {
235 function ensureContext(): SyncContext<TRow, TKey> {
236 const context = getContext()
237 if (!context) {
238 throw new SyncNotInitializedError()
239 }
240 return context
241 }
242
243 return {
244 writeInsert(data: TInsertInput | Array<TInsertInput>) {

Callers 5

writeInsertFunction · 0.85
writeUpdateFunction · 0.85
writeDeleteFunction · 0.85
writeUpsertFunction · 0.85
writeBatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected