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

Function getLoadKey

packages/db-sqlite-persistence-core/src/persisted.ts:2218–2232  ·  view source on GitHub ↗
(options: LoadSubsetOptions)

Source from the content-addressed store, hash-verified

2216 const loadSubscriptionIds = new WeakMap<object, string>()
2217 let nextLoadSubscriptionId = 0
2218 const getLoadKey = (options: LoadSubsetOptions) => {
2219 const subscription = options.subscription as object | undefined
2220 if (subscription && typeof subscription === `object`) {
2221 const existingId = loadSubscriptionIds.get(subscription)
2222 if (existingId) {
2223 return `sub:${existingId}`
2224 }
2225 nextLoadSubscriptionId++
2226 const nextId = String(nextLoadSubscriptionId)
2227 loadSubscriptionIds.set(subscription, nextId)
2228 return `sub:${nextId}`
2229 }
2230
2231 return `opts:${stableSerialize(normalizeSubsetOptionsForKey(options))}`
2232 }
2233 runtime.setSyncControls({
2234 begin: params.begin,
2235 write: params.write as SyncControlFns<T, TKey>[`write`],

Callers 1

createWrappedSyncConfigFunction · 0.85

Calls 4

stableSerializeFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…