[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-db-corecustom-adapter":3,"mdc--sv7g1l-key":32,"related-org-tanstack-db-corecustom-adapter":6198,"related-repo-tanstack-db-corecustom-adapter":6342},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":27,"sourceUrl":30,"mdContent":31},"db-corecustom-adapter","db-core\u002Fcustom-adapter","build custom TanStack collection adapters","Building custom collection adapters for new backends. SyncConfig interface: sync function receiving begin, write, commit, markReady, truncate, metadata primitives. ChangeMessage format (insert, update, delete). loadSubset for on-demand sync. LoadSubsetOptions (where, orderBy, limit, cursor). Expression parsing: parseWhereExpression, parseOrderByExpression, extractSimpleComparisons, parseLoadSubsetOptions. Collection options creator pattern. rowUpdateMode (partial vs full). Subscription lifecycle and cleanup functions. Persisted sync metadata API (metadata.row and metadata.collection) for storing per-row and per-collection adapter state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20],{"name":14,"slug":15,"type":16},"Database","database","tag",{"name":18,"slug":19,"type":16},"Engineering","engineering",{"name":10,"slug":9,"type":16},3811,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb","2026-07-16T06:04:06.862485",null,245,[],{"repoUrl":22,"stars":21,"forks":25,"topics":28,"description":29},[],"The reactive client store for your API.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fdb\u002Ftree\u002FHEAD\u002Fpackages\u002Fdb\u002Fskills\u002Fdb-core\u002Fcustom-adapter","---\nname: db-core\u002Fcustom-adapter\ndescription: >\n  Building custom collection adapters for new backends. SyncConfig interface:\n  sync function receiving begin, write, commit, markReady, truncate, metadata\n  primitives. ChangeMessage format (insert, update, delete). loadSubset for\n  on-demand sync. LoadSubsetOptions (where, orderBy, limit, cursor). Expression\n  parsing: parseWhereExpression, parseOrderByExpression,\n  extractSimpleComparisons, parseLoadSubsetOptions. Collection options creator\n  pattern. rowUpdateMode (partial vs full). Subscription lifecycle and cleanup\n  functions. Persisted sync metadata API (metadata.row and metadata.collection)\n  for storing per-row and per-collection adapter state.\ntype: sub-skill\nlibrary: db\nlibrary_version: '0.6.0'\nsources:\n  - 'TanStack\u002Fdb:docs\u002Fguides\u002Fcollection-options-creator.md'\n  - 'TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fsync.ts'\n---\n\nThis skill builds on db-core and db-core\u002Fcollection-setup. Read those first.\n\n# Custom Adapter Authoring\n\n## Setup\n\n```ts\nimport { createCollection } from '@tanstack\u002Fdb'\nimport type { SyncConfig, CollectionConfig } from '@tanstack\u002Fdb'\n\ninterface MyItem {\n  id: string\n  name: string\n}\n\nfunction myBackendCollectionOptions\u003CT>(config: {\n  endpoint: string\n  getKey: (item: T) => string\n}): CollectionConfig\u003CT, string, {}> {\n  return {\n    getKey: config.getKey,\n    sync: {\n      sync: ({ begin, write, commit, markReady, metadata, collection }) => {\n        let isInitialSyncComplete = false\n        const bufferedEvents: Array\u003Cany> = []\n\n        \u002F\u002F 1. Subscribe to real-time events FIRST\n        const unsubscribe = myWebSocket.subscribe(config.endpoint, (event) => {\n          if (!isInitialSyncComplete) {\n            bufferedEvents.push(event)\n            return\n          }\n          begin()\n          write({ type: event.type, key: event.id, value: event.data })\n          commit()\n        })\n\n        \u002F\u002F 2. Fetch initial data\n        fetch(config.endpoint).then(async (res) => {\n          const items = await res.json()\n          begin()\n          for (const item of items) {\n            write({ type: 'insert', value: item })\n          }\n          commit()\n\n          \u002F\u002F 3. Process buffered events\n          isInitialSyncComplete = true\n          for (const event of bufferedEvents) {\n            begin()\n            write({ type: event.type, key: event.id, value: event.data })\n            commit()\n          }\n\n          \u002F\u002F 4. Signal readiness\n          markReady()\n        })\n\n        \u002F\u002F 5. Return cleanup function\n        return () => {\n          unsubscribe()\n        }\n      },\n      rowUpdateMode: 'partial',\n    },\n    onInsert: async ({ transaction }) => {\n      await fetch(config.endpoint, {\n        method: 'POST',\n        body: JSON.stringify(transaction.mutations[0].modified),\n      })\n    },\n    onUpdate: async ({ transaction }) => {\n      const mut = transaction.mutations[0]\n      await fetch(`${config.endpoint}\u002F${mut.key}`, {\n        method: 'PATCH',\n        body: JSON.stringify(mut.changes),\n      })\n    },\n    onDelete: async ({ transaction }) => {\n      await fetch(`${config.endpoint}\u002F${transaction.mutations[0].key}`, {\n        method: 'DELETE',\n      })\n    },\n  }\n}\n```\n\n## Core Patterns\n\n### ChangeMessage format\n\n```ts\n\u002F\u002F Insert\nwrite({ type: 'insert', value: item })\n\n\u002F\u002F Update (partial — only changed fields)\nwrite({ type: 'update', key: itemId, value: partialItem })\n\n\u002F\u002F Update (full row replacement)\nwrite({ type: 'update', key: itemId, value: fullItem })\n\u002F\u002F Set rowUpdateMode: \"full\" in sync config\n\n\u002F\u002F Delete\nwrite({ type: 'delete', key: itemId, value: item })\n```\n\n### On-demand sync with loadSubset\n\n```ts\nimport { parseLoadSubsetOptions } from \"@tanstack\u002Fdb\"\n\nsync: {\n  sync: ({ begin, write, commit, markReady }) => {\n    \u002F\u002F Initial sync...\n    markReady()\n    return () => {}\n  },\n  loadSubset: async (options) => {\n    const { filters, sorts, limit, offset } = parseLoadSubsetOptions(options)\n    \u002F\u002F filters: [{ field: ['category'], operator: 'eq', value: 'electronics' }]\n    \u002F\u002F sorts:   [{ field: ['price'], direction: 'asc', nulls: 'last' }]\n    const params = new URLSearchParams()\n    for (const f of filters) {\n      params.set(f.field.join(\".\"), `${f.operator}:${f.value}`)\n    }\n    const res = await fetch(`\u002Fapi\u002Fitems?${params}`)\n    return res.json()\n  },\n}\n```\n\n### Managing optimistic state duration\n\nMutation handlers must not resolve until server changes have synced back to the collection. Five strategies:\n\n1. **Refetch** (simplest): `await collection.utils.refetch()`\n2. **Transaction ID**: return `{ txid }` and track via sync stream\n3. **ID-based tracking**: await specific record ID appearing in sync stream\n4. **Version\u002Ftimestamp**: wait until sync stream catches up to mutation time\n5. **Provider method**: `await backend.waitForPendingWrites()`\n\n### Persisted sync metadata\n\nThe `metadata` API on the sync config allows adapters to store per-row and per-collection metadata that persists across sync transactions. This is useful for tracking resume tokens, cursors, LSNs, or other adapter-specific state.\n\nThe `metadata` object is available as a property on the sync config argument alongside `begin`, `write`, `commit`, etc. It is always provided, but without persistence the metadata is in-memory only and does not survive reloads. With persistence, metadata is durable across sessions.\n\n```ts\nsync: ({ begin, write, commit, markReady, metadata }) => {\n  \u002F\u002F Row metadata: store per-row state (e.g. server version, ETag)\n  metadata.row.get(key) \u002F\u002F => unknown | undefined\n  metadata.row.set(key, { version: 3, etag: 'abc' })\n  metadata.row.delete(key)\n\n  \u002F\u002F Collection metadata: store per-collection state (e.g. resume cursor)\n  metadata.collection.get('cursor') \u002F\u002F => unknown | undefined\n  metadata.collection.set('cursor', 'token_abc123')\n  metadata.collection.delete('cursor')\n  metadata.collection.list() \u002F\u002F => [{ key: 'cursor', value: 'token_abc123' }]\n  metadata.collection.list('resume') \u002F\u002F filter by prefix\n}\n```\n\nRow metadata writes are tied to the current transaction. When a row is deleted via `write({ type: 'delete', ... })`, its row metadata is automatically deleted. When a row is inserted, its metadata is set from `message.metadata` if provided, or deleted otherwise.\n\nCollection metadata writes staged before `truncate()` are preserved and commit atomically with the truncate transaction.\n\n**Typical usage — resume token:**\n\n```ts\nsync: ({ begin, write, commit, markReady, metadata }) => {\n  const lastCursor = metadata.collection.get('cursor') as string | undefined\n\n  const stream = subscribeFromCursor(lastCursor)\n  stream.on('data', (batch) => {\n    begin()\n    for (const item of batch.items) {\n      write({ type: item.type, key: item.id, value: item.data })\n    }\n    metadata.collection.set('cursor', batch.cursor)\n    commit()\n  })\n\n  stream.on('ready', () => markReady())\n  return () => stream.close()\n}\n```\n\n### Expression parsing for predicate push-down\n\n```ts\nimport {\n  parseWhereExpression,\n  parseOrderByExpression,\n  extractSimpleComparisons,\n} from '@tanstack\u002Fdb'\n\n\u002F\u002F In loadSubset or queryFn:\nconst comparisons = extractSimpleComparisons(options.where)\n\u002F\u002F Returns: [{ field: ['name'], operator: 'eq', value: 'John' }]\n\nconst orderBy = parseOrderByExpression(options.orderBy)\n\u002F\u002F Returns: [{ field: ['created_at'], direction: 'desc', nulls: 'last' }]\n```\n\n## Common Mistakes\n\n### CRITICAL Not calling markReady() in sync implementation\n\nWrong:\n\n```ts\nsync: ({ begin, write, commit }) => {\n  fetchData().then((items) => {\n    begin()\n    items.forEach((item) => write({ type: 'insert', value: item }))\n    commit()\n    \u002F\u002F forgot markReady()!\n  })\n}\n```\n\nCorrect:\n\n```ts\nsync: ({ begin, write, commit, markReady }) => {\n  fetchData().then((items) => {\n    begin()\n    items.forEach((item) => write({ type: 'insert', value: item }))\n    commit()\n    markReady()\n  })\n}\n```\n\n`markReady()` transitions the collection to \"ready\" status. Without it, live queries never resolve and `useLiveSuspenseQuery` hangs forever in Suspense.\n\nSource: docs\u002Fguides\u002Fcollection-options-creator.md\n\n### HIGH Race condition: subscribing after initial fetch\n\nWrong:\n\n```ts\nsync: ({ begin, write, commit, markReady }) => {\n  fetchAll().then((data) => {\n    writeAll(data)\n    subscribe(onChange) \u002F\u002F changes during fetch are LOST\n    markReady()\n  })\n}\n```\n\nCorrect:\n\n```ts\nsync: ({ begin, write, commit, markReady }) => {\n  const buffer = []\n  subscribe((event) => {\n    if (!ready) {\n      buffer.push(event)\n      return\n    }\n    begin()\n    write(event)\n    commit()\n  })\n  fetchAll().then((data) => {\n    writeAll(data)\n    ready = true\n    buffer.forEach((e) => {\n      begin()\n      write(e)\n      commit()\n    })\n    markReady()\n  })\n}\n```\n\nSubscribe to real-time events before fetching initial data. Buffer events during the fetch, then replay them after the initial sync completes.\n\nSource: docs\u002Fguides\u002Fcollection-options-creator.md\n\n### HIGH write() called without begin()\n\nWrong:\n\n```ts\nonMessage((event) => {\n  write({ type: event.type, key: event.id, value: event.data })\n  commit()\n})\n```\n\nCorrect:\n\n```ts\nonMessage((event) => {\n  begin()\n  write({ type: event.type, key: event.id, value: event.data })\n  commit()\n})\n```\n\nSync data must be written within a transaction (`begin` → `write` → `commit`). Calling `write()` without `begin()` throws `NoPendingSyncTransactionWriteError`.\n\nSource: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fsync.ts:110\n\n## Tension: Simplicity vs. Correctness in Sync\n\nGetting-started simplicity (localOnly, eager mode) conflicts with production correctness (on-demand sync, race condition prevention, proper markReady handling). Agents optimizing for quick setup tend to skip buffering, markReady, and cleanup functions.\n\nSee also: db-core\u002Fcollection-setup\u002FSKILL.md — for built-in adapter patterns to model after.\n",{"data":33,"body":40},{"name":5,"description":7,"type":34,"library":35,"library_version":36,"sources":37},"sub-skill","db","0.6.0",[38,39],"TanStack\u002Fdb:docs\u002Fguides\u002Fcollection-options-creator.md","TanStack\u002Fdb:packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fsync.ts",{"type":41,"children":42},"root",[43,51,58,65,2199,2205,2212,2571,2577,3157,3163,3168,3244,3250,3263,3296,3796,3817,3830,3838,4422,4428,4613,4619,4625,4630,4871,4876,5123,5142,5147,5153,5157,5338,5342,5783,5788,5792,5798,5802,5956,5960,6123,6171,6176,6182,6187,6192],{"type":44,"tag":45,"props":46,"children":47},"element","p",{},[48],{"type":49,"value":50},"text","This skill builds on db-core and db-core\u002Fcollection-setup. Read those first.",{"type":44,"tag":52,"props":53,"children":55},"h1",{"id":54},"custom-adapter-authoring",[56],{"type":49,"value":57},"Custom Adapter Authoring",{"type":44,"tag":59,"props":60,"children":62},"h2",{"id":61},"setup",[63],{"type":49,"value":64},"Setup",{"type":44,"tag":66,"props":67,"children":72},"pre",{"className":68,"code":69,"language":70,"meta":71,"style":71},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createCollection } from '@tanstack\u002Fdb'\nimport type { SyncConfig, CollectionConfig } from '@tanstack\u002Fdb'\n\ninterface MyItem {\n  id: string\n  name: string\n}\n\nfunction myBackendCollectionOptions\u003CT>(config: {\n  endpoint: string\n  getKey: (item: T) => string\n}): CollectionConfig\u003CT, string, {}> {\n  return {\n    getKey: config.getKey,\n    sync: {\n      sync: ({ begin, write, commit, markReady, metadata, collection }) => {\n        let isInitialSyncComplete = false\n        const bufferedEvents: Array\u003Cany> = []\n\n        \u002F\u002F 1. Subscribe to real-time events FIRST\n        const unsubscribe = myWebSocket.subscribe(config.endpoint, (event) => {\n          if (!isInitialSyncComplete) {\n            bufferedEvents.push(event)\n            return\n          }\n          begin()\n          write({ type: event.type, key: event.id, value: event.data })\n          commit()\n        })\n\n        \u002F\u002F 2. Fetch initial data\n        fetch(config.endpoint).then(async (res) => {\n          const items = await res.json()\n          begin()\n          for (const item of items) {\n            write({ type: 'insert', value: item })\n          }\n          commit()\n\n          \u002F\u002F 3. Process buffered events\n          isInitialSyncComplete = true\n          for (const event of bufferedEvents) {\n            begin()\n            write({ type: event.type, key: event.id, value: event.data })\n            commit()\n          }\n\n          \u002F\u002F 4. Signal readiness\n          markReady()\n        })\n\n        \u002F\u002F 5. Return cleanup function\n        return () => {\n          unsubscribe()\n        }\n      },\n      rowUpdateMode: 'partial',\n    },\n    onInsert: async ({ transaction }) => {\n      await fetch(config.endpoint, {\n        method: 'POST',\n        body: JSON.stringify(transaction.mutations[0].modified),\n      })\n    },\n    onUpdate: async ({ transaction }) => {\n      const mut = transaction.mutations[0]\n      await fetch(`${config.endpoint}\u002F${mut.key}`, {\n        method: 'PATCH',\n        body: JSON.stringify(mut.changes),\n      })\n    },\n    onDelete: async ({ transaction }) => {\n      await fetch(`${config.endpoint}\u002F${transaction.mutations[0].key}`, {\n        method: 'DELETE',\n      })\n    },\n  }\n}\n","ts","",[73],{"type":44,"tag":74,"props":75,"children":76},"code",{"__ignoreMap":71},[77,127,179,189,210,230,247,256,264,308,325,371,414,427,460,477,558,583,629,637,647,721,754,785,794,803,817,917,930,943,951,960,1028,1069,1081,1121,1184,1192,1204,1212,1221,1239,1275,1288,1380,1393,1401,1409,1418,1431,1443,1451,1460,1482,1495,1504,1513,1543,1552,1591,1629,1659,1737,1750,1758,1795,1838,1913,1942,1991,2003,2011,2048,2133,2162,2174,2182,2191],{"type":44,"tag":78,"props":79,"children":82},"span",{"class":80,"line":81},"line",1,[83,89,95,101,106,111,116,122],{"type":44,"tag":78,"props":84,"children":86},{"style":85},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[87],{"type":49,"value":88},"import",{"type":44,"tag":78,"props":90,"children":92},{"style":91},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[93],{"type":49,"value":94}," {",{"type":44,"tag":78,"props":96,"children":98},{"style":97},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[99],{"type":49,"value":100}," createCollection",{"type":44,"tag":78,"props":102,"children":103},{"style":91},[104],{"type":49,"value":105}," }",{"type":44,"tag":78,"props":107,"children":108},{"style":85},[109],{"type":49,"value":110}," from",{"type":44,"tag":78,"props":112,"children":113},{"style":91},[114],{"type":49,"value":115}," '",{"type":44,"tag":78,"props":117,"children":119},{"style":118},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[120],{"type":49,"value":121},"@tanstack\u002Fdb",{"type":44,"tag":78,"props":123,"children":124},{"style":91},[125],{"type":49,"value":126},"'\n",{"type":44,"tag":78,"props":128,"children":130},{"class":80,"line":129},2,[131,135,140,144,149,154,159,163,167,171,175],{"type":44,"tag":78,"props":132,"children":133},{"style":85},[134],{"type":49,"value":88},{"type":44,"tag":78,"props":136,"children":137},{"style":85},[138],{"type":49,"value":139}," type",{"type":44,"tag":78,"props":141,"children":142},{"style":91},[143],{"type":49,"value":94},{"type":44,"tag":78,"props":145,"children":146},{"style":97},[147],{"type":49,"value":148}," SyncConfig",{"type":44,"tag":78,"props":150,"children":151},{"style":91},[152],{"type":49,"value":153},",",{"type":44,"tag":78,"props":155,"children":156},{"style":97},[157],{"type":49,"value":158}," CollectionConfig",{"type":44,"tag":78,"props":160,"children":161},{"style":91},[162],{"type":49,"value":105},{"type":44,"tag":78,"props":164,"children":165},{"style":85},[166],{"type":49,"value":110},{"type":44,"tag":78,"props":168,"children":169},{"style":91},[170],{"type":49,"value":115},{"type":44,"tag":78,"props":172,"children":173},{"style":118},[174],{"type":49,"value":121},{"type":44,"tag":78,"props":176,"children":177},{"style":91},[178],{"type":49,"value":126},{"type":44,"tag":78,"props":180,"children":182},{"class":80,"line":181},3,[183],{"type":44,"tag":78,"props":184,"children":186},{"emptyLinePlaceholder":185},true,[187],{"type":49,"value":188},"\n",{"type":44,"tag":78,"props":190,"children":192},{"class":80,"line":191},4,[193,199,205],{"type":44,"tag":78,"props":194,"children":196},{"style":195},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[197],{"type":49,"value":198},"interface",{"type":44,"tag":78,"props":200,"children":202},{"style":201},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[203],{"type":49,"value":204}," MyItem",{"type":44,"tag":78,"props":206,"children":207},{"style":91},[208],{"type":49,"value":209}," {\n",{"type":44,"tag":78,"props":211,"children":213},{"class":80,"line":212},5,[214,220,225],{"type":44,"tag":78,"props":215,"children":217},{"style":216},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[218],{"type":49,"value":219},"  id",{"type":44,"tag":78,"props":221,"children":222},{"style":91},[223],{"type":49,"value":224},":",{"type":44,"tag":78,"props":226,"children":227},{"style":201},[228],{"type":49,"value":229}," string\n",{"type":44,"tag":78,"props":231,"children":233},{"class":80,"line":232},6,[234,239,243],{"type":44,"tag":78,"props":235,"children":236},{"style":216},[237],{"type":49,"value":238},"  name",{"type":44,"tag":78,"props":240,"children":241},{"style":91},[242],{"type":49,"value":224},{"type":44,"tag":78,"props":244,"children":245},{"style":201},[246],{"type":49,"value":229},{"type":44,"tag":78,"props":248,"children":250},{"class":80,"line":249},7,[251],{"type":44,"tag":78,"props":252,"children":253},{"style":91},[254],{"type":49,"value":255},"}\n",{"type":44,"tag":78,"props":257,"children":259},{"class":80,"line":258},8,[260],{"type":44,"tag":78,"props":261,"children":262},{"emptyLinePlaceholder":185},[263],{"type":49,"value":188},{"type":44,"tag":78,"props":265,"children":267},{"class":80,"line":266},9,[268,273,279,284,289,294,300,304],{"type":44,"tag":78,"props":269,"children":270},{"style":195},[271],{"type":49,"value":272},"function",{"type":44,"tag":78,"props":274,"children":276},{"style":275},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[277],{"type":49,"value":278}," myBackendCollectionOptions",{"type":44,"tag":78,"props":280,"children":281},{"style":91},[282],{"type":49,"value":283},"\u003C",{"type":44,"tag":78,"props":285,"children":286},{"style":201},[287],{"type":49,"value":288},"T",{"type":44,"tag":78,"props":290,"children":291},{"style":91},[292],{"type":49,"value":293},">(",{"type":44,"tag":78,"props":295,"children":297},{"style":296},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[298],{"type":49,"value":299},"config",{"type":44,"tag":78,"props":301,"children":302},{"style":91},[303],{"type":49,"value":224},{"type":44,"tag":78,"props":305,"children":306},{"style":91},[307],{"type":49,"value":209},{"type":44,"tag":78,"props":309,"children":311},{"class":80,"line":310},10,[312,317,321],{"type":44,"tag":78,"props":313,"children":314},{"style":216},[315],{"type":49,"value":316},"  endpoint",{"type":44,"tag":78,"props":318,"children":319},{"style":91},[320],{"type":49,"value":224},{"type":44,"tag":78,"props":322,"children":323},{"style":201},[324],{"type":49,"value":229},{"type":44,"tag":78,"props":326,"children":328},{"class":80,"line":327},11,[329,334,338,343,348,352,357,362,367],{"type":44,"tag":78,"props":330,"children":331},{"style":216},[332],{"type":49,"value":333},"  getKey",{"type":44,"tag":78,"props":335,"children":336},{"style":91},[337],{"type":49,"value":224},{"type":44,"tag":78,"props":339,"children":340},{"style":91},[341],{"type":49,"value":342}," (",{"type":44,"tag":78,"props":344,"children":345},{"style":296},[346],{"type":49,"value":347},"item",{"type":44,"tag":78,"props":349,"children":350},{"style":91},[351],{"type":49,"value":224},{"type":44,"tag":78,"props":353,"children":354},{"style":201},[355],{"type":49,"value":356}," T",{"type":44,"tag":78,"props":358,"children":359},{"style":91},[360],{"type":49,"value":361},")",{"type":44,"tag":78,"props":363,"children":364},{"style":195},[365],{"type":49,"value":366}," =>",{"type":44,"tag":78,"props":368,"children":369},{"style":201},[370],{"type":49,"value":229},{"type":44,"tag":78,"props":372,"children":374},{"class":80,"line":373},12,[375,380,384,388,392,396,401,405,410],{"type":44,"tag":78,"props":376,"children":377},{"style":91},[378],{"type":49,"value":379},"}):",{"type":44,"tag":78,"props":381,"children":382},{"style":201},[383],{"type":49,"value":158},{"type":44,"tag":78,"props":385,"children":386},{"style":91},[387],{"type":49,"value":283},{"type":44,"tag":78,"props":389,"children":390},{"style":201},[391],{"type":49,"value":288},{"type":44,"tag":78,"props":393,"children":394},{"style":91},[395],{"type":49,"value":153},{"type":44,"tag":78,"props":397,"children":398},{"style":201},[399],{"type":49,"value":400}," string",{"type":44,"tag":78,"props":402,"children":403},{"style":91},[404],{"type":49,"value":153},{"type":44,"tag":78,"props":406,"children":407},{"style":91},[408],{"type":49,"value":409}," {}>",{"type":44,"tag":78,"props":411,"children":412},{"style":91},[413],{"type":49,"value":209},{"type":44,"tag":78,"props":415,"children":417},{"class":80,"line":416},13,[418,423],{"type":44,"tag":78,"props":419,"children":420},{"style":85},[421],{"type":49,"value":422},"  return",{"type":44,"tag":78,"props":424,"children":425},{"style":91},[426],{"type":49,"value":209},{"type":44,"tag":78,"props":428,"children":430},{"class":80,"line":429},14,[431,436,440,445,450,455],{"type":44,"tag":78,"props":432,"children":433},{"style":216},[434],{"type":49,"value":435},"    getKey",{"type":44,"tag":78,"props":437,"children":438},{"style":91},[439],{"type":49,"value":224},{"type":44,"tag":78,"props":441,"children":442},{"style":97},[443],{"type":49,"value":444}," config",{"type":44,"tag":78,"props":446,"children":447},{"style":91},[448],{"type":49,"value":449},".",{"type":44,"tag":78,"props":451,"children":452},{"style":97},[453],{"type":49,"value":454},"getKey",{"type":44,"tag":78,"props":456,"children":457},{"style":91},[458],{"type":49,"value":459},",\n",{"type":44,"tag":78,"props":461,"children":463},{"class":80,"line":462},15,[464,469,473],{"type":44,"tag":78,"props":465,"children":466},{"style":216},[467],{"type":49,"value":468},"    sync",{"type":44,"tag":78,"props":470,"children":471},{"style":91},[472],{"type":49,"value":224},{"type":44,"tag":78,"props":474,"children":475},{"style":91},[476],{"type":49,"value":209},{"type":44,"tag":78,"props":478,"children":480},{"class":80,"line":479},16,[481,486,490,495,500,504,509,513,518,522,527,531,536,540,545,550,554],{"type":44,"tag":78,"props":482,"children":483},{"style":275},[484],{"type":49,"value":485},"      sync",{"type":44,"tag":78,"props":487,"children":488},{"style":91},[489],{"type":49,"value":224},{"type":44,"tag":78,"props":491,"children":492},{"style":91},[493],{"type":49,"value":494}," ({",{"type":44,"tag":78,"props":496,"children":497},{"style":296},[498],{"type":49,"value":499}," begin",{"type":44,"tag":78,"props":501,"children":502},{"style":91},[503],{"type":49,"value":153},{"type":44,"tag":78,"props":505,"children":506},{"style":296},[507],{"type":49,"value":508}," write",{"type":44,"tag":78,"props":510,"children":511},{"style":91},[512],{"type":49,"value":153},{"type":44,"tag":78,"props":514,"children":515},{"style":296},[516],{"type":49,"value":517}," commit",{"type":44,"tag":78,"props":519,"children":520},{"style":91},[521],{"type":49,"value":153},{"type":44,"tag":78,"props":523,"children":524},{"style":296},[525],{"type":49,"value":526}," markReady",{"type":44,"tag":78,"props":528,"children":529},{"style":91},[530],{"type":49,"value":153},{"type":44,"tag":78,"props":532,"children":533},{"style":296},[534],{"type":49,"value":535}," metadata",{"type":44,"tag":78,"props":537,"children":538},{"style":91},[539],{"type":49,"value":153},{"type":44,"tag":78,"props":541,"children":542},{"style":296},[543],{"type":49,"value":544}," collection",{"type":44,"tag":78,"props":546,"children":547},{"style":91},[548],{"type":49,"value":549}," })",{"type":44,"tag":78,"props":551,"children":552},{"style":195},[553],{"type":49,"value":366},{"type":44,"tag":78,"props":555,"children":556},{"style":91},[557],{"type":49,"value":209},{"type":44,"tag":78,"props":559,"children":561},{"class":80,"line":560},17,[562,567,572,577],{"type":44,"tag":78,"props":563,"children":564},{"style":195},[565],{"type":49,"value":566},"        let",{"type":44,"tag":78,"props":568,"children":569},{"style":97},[570],{"type":49,"value":571}," isInitialSyncComplete",{"type":44,"tag":78,"props":573,"children":574},{"style":91},[575],{"type":49,"value":576}," =",{"type":44,"tag":78,"props":578,"children":580},{"style":579},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[581],{"type":49,"value":582}," false\n",{"type":44,"tag":78,"props":584,"children":586},{"class":80,"line":585},18,[587,592,597,601,606,610,615,620,624],{"type":44,"tag":78,"props":588,"children":589},{"style":195},[590],{"type":49,"value":591},"        const",{"type":44,"tag":78,"props":593,"children":594},{"style":97},[595],{"type":49,"value":596}," bufferedEvents",{"type":44,"tag":78,"props":598,"children":599},{"style":91},[600],{"type":49,"value":224},{"type":44,"tag":78,"props":602,"children":603},{"style":201},[604],{"type":49,"value":605}," Array",{"type":44,"tag":78,"props":607,"children":608},{"style":91},[609],{"type":49,"value":283},{"type":44,"tag":78,"props":611,"children":612},{"style":201},[613],{"type":49,"value":614},"any",{"type":44,"tag":78,"props":616,"children":617},{"style":91},[618],{"type":49,"value":619},">",{"type":44,"tag":78,"props":621,"children":622},{"style":91},[623],{"type":49,"value":576},{"type":44,"tag":78,"props":625,"children":626},{"style":216},[627],{"type":49,"value":628}," []\n",{"type":44,"tag":78,"props":630,"children":632},{"class":80,"line":631},19,[633],{"type":44,"tag":78,"props":634,"children":635},{"emptyLinePlaceholder":185},[636],{"type":49,"value":188},{"type":44,"tag":78,"props":638,"children":640},{"class":80,"line":639},20,[641],{"type":44,"tag":78,"props":642,"children":644},{"style":643},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[645],{"type":49,"value":646},"        \u002F\u002F 1. Subscribe to real-time events FIRST\n",{"type":44,"tag":78,"props":648,"children":650},{"class":80,"line":649},21,[651,655,660,664,669,673,678,683,687,691,696,700,704,709,713,717],{"type":44,"tag":78,"props":652,"children":653},{"style":195},[654],{"type":49,"value":591},{"type":44,"tag":78,"props":656,"children":657},{"style":97},[658],{"type":49,"value":659}," unsubscribe",{"type":44,"tag":78,"props":661,"children":662},{"style":91},[663],{"type":49,"value":576},{"type":44,"tag":78,"props":665,"children":666},{"style":97},[667],{"type":49,"value":668}," myWebSocket",{"type":44,"tag":78,"props":670,"children":671},{"style":91},[672],{"type":49,"value":449},{"type":44,"tag":78,"props":674,"children":675},{"style":275},[676],{"type":49,"value":677},"subscribe",{"type":44,"tag":78,"props":679,"children":680},{"style":216},[681],{"type":49,"value":682},"(",{"type":44,"tag":78,"props":684,"children":685},{"style":97},[686],{"type":49,"value":299},{"type":44,"tag":78,"props":688,"children":689},{"style":91},[690],{"type":49,"value":449},{"type":44,"tag":78,"props":692,"children":693},{"style":97},[694],{"type":49,"value":695},"endpoint",{"type":44,"tag":78,"props":697,"children":698},{"style":91},[699],{"type":49,"value":153},{"type":44,"tag":78,"props":701,"children":702},{"style":91},[703],{"type":49,"value":342},{"type":44,"tag":78,"props":705,"children":706},{"style":296},[707],{"type":49,"value":708},"event",{"type":44,"tag":78,"props":710,"children":711},{"style":91},[712],{"type":49,"value":361},{"type":44,"tag":78,"props":714,"children":715},{"style":195},[716],{"type":49,"value":366},{"type":44,"tag":78,"props":718,"children":719},{"style":91},[720],{"type":49,"value":209},{"type":44,"tag":78,"props":722,"children":724},{"class":80,"line":723},22,[725,730,734,739,744,749],{"type":44,"tag":78,"props":726,"children":727},{"style":85},[728],{"type":49,"value":729},"          if",{"type":44,"tag":78,"props":731,"children":732},{"style":216},[733],{"type":49,"value":342},{"type":44,"tag":78,"props":735,"children":736},{"style":91},[737],{"type":49,"value":738},"!",{"type":44,"tag":78,"props":740,"children":741},{"style":97},[742],{"type":49,"value":743},"isInitialSyncComplete",{"type":44,"tag":78,"props":745,"children":746},{"style":216},[747],{"type":49,"value":748},") ",{"type":44,"tag":78,"props":750,"children":751},{"style":91},[752],{"type":49,"value":753},"{\n",{"type":44,"tag":78,"props":755,"children":757},{"class":80,"line":756},23,[758,763,767,772,776,780],{"type":44,"tag":78,"props":759,"children":760},{"style":97},[761],{"type":49,"value":762},"            bufferedEvents",{"type":44,"tag":78,"props":764,"children":765},{"style":91},[766],{"type":49,"value":449},{"type":44,"tag":78,"props":768,"children":769},{"style":275},[770],{"type":49,"value":771},"push",{"type":44,"tag":78,"props":773,"children":774},{"style":216},[775],{"type":49,"value":682},{"type":44,"tag":78,"props":777,"children":778},{"style":97},[779],{"type":49,"value":708},{"type":44,"tag":78,"props":781,"children":782},{"style":216},[783],{"type":49,"value":784},")\n",{"type":44,"tag":78,"props":786,"children":788},{"class":80,"line":787},24,[789],{"type":44,"tag":78,"props":790,"children":791},{"style":85},[792],{"type":49,"value":793},"            return\n",{"type":44,"tag":78,"props":795,"children":797},{"class":80,"line":796},25,[798],{"type":44,"tag":78,"props":799,"children":800},{"style":91},[801],{"type":49,"value":802},"          }\n",{"type":44,"tag":78,"props":804,"children":806},{"class":80,"line":805},26,[807,812],{"type":44,"tag":78,"props":808,"children":809},{"style":275},[810],{"type":49,"value":811},"          begin",{"type":44,"tag":78,"props":813,"children":814},{"style":216},[815],{"type":49,"value":816},"()\n",{"type":44,"tag":78,"props":818,"children":820},{"class":80,"line":819},27,[821,826,830,835,839,843,848,852,857,861,866,870,874,878,883,887,892,896,900,904,909,913],{"type":44,"tag":78,"props":822,"children":823},{"style":275},[824],{"type":49,"value":825},"          write",{"type":44,"tag":78,"props":827,"children":828},{"style":216},[829],{"type":49,"value":682},{"type":44,"tag":78,"props":831,"children":832},{"style":91},[833],{"type":49,"value":834},"{",{"type":44,"tag":78,"props":836,"children":837},{"style":216},[838],{"type":49,"value":139},{"type":44,"tag":78,"props":840,"children":841},{"style":91},[842],{"type":49,"value":224},{"type":44,"tag":78,"props":844,"children":845},{"style":97},[846],{"type":49,"value":847}," event",{"type":44,"tag":78,"props":849,"children":850},{"style":91},[851],{"type":49,"value":449},{"type":44,"tag":78,"props":853,"children":854},{"style":97},[855],{"type":49,"value":856},"type",{"type":44,"tag":78,"props":858,"children":859},{"style":91},[860],{"type":49,"value":153},{"type":44,"tag":78,"props":862,"children":863},{"style":216},[864],{"type":49,"value":865}," key",{"type":44,"tag":78,"props":867,"children":868},{"style":91},[869],{"type":49,"value":224},{"type":44,"tag":78,"props":871,"children":872},{"style":97},[873],{"type":49,"value":847},{"type":44,"tag":78,"props":875,"children":876},{"style":91},[877],{"type":49,"value":449},{"type":44,"tag":78,"props":879,"children":880},{"style":97},[881],{"type":49,"value":882},"id",{"type":44,"tag":78,"props":884,"children":885},{"style":91},[886],{"type":49,"value":153},{"type":44,"tag":78,"props":888,"children":889},{"style":216},[890],{"type":49,"value":891}," value",{"type":44,"tag":78,"props":893,"children":894},{"style":91},[895],{"type":49,"value":224},{"type":44,"tag":78,"props":897,"children":898},{"style":97},[899],{"type":49,"value":847},{"type":44,"tag":78,"props":901,"children":902},{"style":91},[903],{"type":49,"value":449},{"type":44,"tag":78,"props":905,"children":906},{"style":97},[907],{"type":49,"value":908},"data",{"type":44,"tag":78,"props":910,"children":911},{"style":91},[912],{"type":49,"value":105},{"type":44,"tag":78,"props":914,"children":915},{"style":216},[916],{"type":49,"value":784},{"type":44,"tag":78,"props":918,"children":920},{"class":80,"line":919},28,[921,926],{"type":44,"tag":78,"props":922,"children":923},{"style":275},[924],{"type":49,"value":925},"          commit",{"type":44,"tag":78,"props":927,"children":928},{"style":216},[929],{"type":49,"value":816},{"type":44,"tag":78,"props":931,"children":933},{"class":80,"line":932},29,[934,939],{"type":44,"tag":78,"props":935,"children":936},{"style":91},[937],{"type":49,"value":938},"        }",{"type":44,"tag":78,"props":940,"children":941},{"style":216},[942],{"type":49,"value":784},{"type":44,"tag":78,"props":944,"children":946},{"class":80,"line":945},30,[947],{"type":44,"tag":78,"props":948,"children":949},{"emptyLinePlaceholder":185},[950],{"type":49,"value":188},{"type":44,"tag":78,"props":952,"children":954},{"class":80,"line":953},31,[955],{"type":44,"tag":78,"props":956,"children":957},{"style":643},[958],{"type":49,"value":959},"        \u002F\u002F 2. Fetch initial data\n",{"type":44,"tag":78,"props":961,"children":963},{"class":80,"line":962},32,[964,969,973,977,981,985,989,993,998,1002,1007,1011,1016,1020,1024],{"type":44,"tag":78,"props":965,"children":966},{"style":275},[967],{"type":49,"value":968},"        fetch",{"type":44,"tag":78,"props":970,"children":971},{"style":216},[972],{"type":49,"value":682},{"type":44,"tag":78,"props":974,"children":975},{"style":97},[976],{"type":49,"value":299},{"type":44,"tag":78,"props":978,"children":979},{"style":91},[980],{"type":49,"value":449},{"type":44,"tag":78,"props":982,"children":983},{"style":97},[984],{"type":49,"value":695},{"type":44,"tag":78,"props":986,"children":987},{"style":216},[988],{"type":49,"value":361},{"type":44,"tag":78,"props":990,"children":991},{"style":91},[992],{"type":49,"value":449},{"type":44,"tag":78,"props":994,"children":995},{"style":275},[996],{"type":49,"value":997},"then",{"type":44,"tag":78,"props":999,"children":1000},{"style":216},[1001],{"type":49,"value":682},{"type":44,"tag":78,"props":1003,"children":1004},{"style":195},[1005],{"type":49,"value":1006},"async",{"type":44,"tag":78,"props":1008,"children":1009},{"style":91},[1010],{"type":49,"value":342},{"type":44,"tag":78,"props":1012,"children":1013},{"style":296},[1014],{"type":49,"value":1015},"res",{"type":44,"tag":78,"props":1017,"children":1018},{"style":91},[1019],{"type":49,"value":361},{"type":44,"tag":78,"props":1021,"children":1022},{"style":195},[1023],{"type":49,"value":366},{"type":44,"tag":78,"props":1025,"children":1026},{"style":91},[1027],{"type":49,"value":209},{"type":44,"tag":78,"props":1029,"children":1031},{"class":80,"line":1030},33,[1032,1037,1042,1046,1051,1056,1060,1065],{"type":44,"tag":78,"props":1033,"children":1034},{"style":195},[1035],{"type":49,"value":1036},"          const",{"type":44,"tag":78,"props":1038,"children":1039},{"style":97},[1040],{"type":49,"value":1041}," items",{"type":44,"tag":78,"props":1043,"children":1044},{"style":91},[1045],{"type":49,"value":576},{"type":44,"tag":78,"props":1047,"children":1048},{"style":85},[1049],{"type":49,"value":1050}," await",{"type":44,"tag":78,"props":1052,"children":1053},{"style":97},[1054],{"type":49,"value":1055}," res",{"type":44,"tag":78,"props":1057,"children":1058},{"style":91},[1059],{"type":49,"value":449},{"type":44,"tag":78,"props":1061,"children":1062},{"style":275},[1063],{"type":49,"value":1064},"json",{"type":44,"tag":78,"props":1066,"children":1067},{"style":216},[1068],{"type":49,"value":816},{"type":44,"tag":78,"props":1070,"children":1072},{"class":80,"line":1071},34,[1073,1077],{"type":44,"tag":78,"props":1074,"children":1075},{"style":275},[1076],{"type":49,"value":811},{"type":44,"tag":78,"props":1078,"children":1079},{"style":216},[1080],{"type":49,"value":816},{"type":44,"tag":78,"props":1082,"children":1084},{"class":80,"line":1083},35,[1085,1090,1094,1099,1104,1109,1113,1117],{"type":44,"tag":78,"props":1086,"children":1087},{"style":85},[1088],{"type":49,"value":1089},"          for",{"type":44,"tag":78,"props":1091,"children":1092},{"style":216},[1093],{"type":49,"value":342},{"type":44,"tag":78,"props":1095,"children":1096},{"style":195},[1097],{"type":49,"value":1098},"const",{"type":44,"tag":78,"props":1100,"children":1101},{"style":97},[1102],{"type":49,"value":1103}," item",{"type":44,"tag":78,"props":1105,"children":1106},{"style":91},[1107],{"type":49,"value":1108}," of",{"type":44,"tag":78,"props":1110,"children":1111},{"style":97},[1112],{"type":49,"value":1041},{"type":44,"tag":78,"props":1114,"children":1115},{"style":216},[1116],{"type":49,"value":748},{"type":44,"tag":78,"props":1118,"children":1119},{"style":91},[1120],{"type":49,"value":753},{"type":44,"tag":78,"props":1122,"children":1124},{"class":80,"line":1123},36,[1125,1130,1134,1138,1142,1146,1150,1155,1160,1164,1168,1172,1176,1180],{"type":44,"tag":78,"props":1126,"children":1127},{"style":275},[1128],{"type":49,"value":1129},"            write",{"type":44,"tag":78,"props":1131,"children":1132},{"style":216},[1133],{"type":49,"value":682},{"type":44,"tag":78,"props":1135,"children":1136},{"style":91},[1137],{"type":49,"value":834},{"type":44,"tag":78,"props":1139,"children":1140},{"style":216},[1141],{"type":49,"value":139},{"type":44,"tag":78,"props":1143,"children":1144},{"style":91},[1145],{"type":49,"value":224},{"type":44,"tag":78,"props":1147,"children":1148},{"style":91},[1149],{"type":49,"value":115},{"type":44,"tag":78,"props":1151,"children":1152},{"style":118},[1153],{"type":49,"value":1154},"insert",{"type":44,"tag":78,"props":1156,"children":1157},{"style":91},[1158],{"type":49,"value":1159},"'",{"type":44,"tag":78,"props":1161,"children":1162},{"style":91},[1163],{"type":49,"value":153},{"type":44,"tag":78,"props":1165,"children":1166},{"style":216},[1167],{"type":49,"value":891},{"type":44,"tag":78,"props":1169,"children":1170},{"style":91},[1171],{"type":49,"value":224},{"type":44,"tag":78,"props":1173,"children":1174},{"style":97},[1175],{"type":49,"value":1103},{"type":44,"tag":78,"props":1177,"children":1178},{"style":91},[1179],{"type":49,"value":105},{"type":44,"tag":78,"props":1181,"children":1182},{"style":216},[1183],{"type":49,"value":784},{"type":44,"tag":78,"props":1185,"children":1187},{"class":80,"line":1186},37,[1188],{"type":44,"tag":78,"props":1189,"children":1190},{"style":91},[1191],{"type":49,"value":802},{"type":44,"tag":78,"props":1193,"children":1195},{"class":80,"line":1194},38,[1196,1200],{"type":44,"tag":78,"props":1197,"children":1198},{"style":275},[1199],{"type":49,"value":925},{"type":44,"tag":78,"props":1201,"children":1202},{"style":216},[1203],{"type":49,"value":816},{"type":44,"tag":78,"props":1205,"children":1207},{"class":80,"line":1206},39,[1208],{"type":44,"tag":78,"props":1209,"children":1210},{"emptyLinePlaceholder":185},[1211],{"type":49,"value":188},{"type":44,"tag":78,"props":1213,"children":1215},{"class":80,"line":1214},40,[1216],{"type":44,"tag":78,"props":1217,"children":1218},{"style":643},[1219],{"type":49,"value":1220},"          \u002F\u002F 3. Process buffered events\n",{"type":44,"tag":78,"props":1222,"children":1224},{"class":80,"line":1223},41,[1225,1230,1234],{"type":44,"tag":78,"props":1226,"children":1227},{"style":97},[1228],{"type":49,"value":1229},"          isInitialSyncComplete",{"type":44,"tag":78,"props":1231,"children":1232},{"style":91},[1233],{"type":49,"value":576},{"type":44,"tag":78,"props":1235,"children":1236},{"style":579},[1237],{"type":49,"value":1238}," true\n",{"type":44,"tag":78,"props":1240,"children":1242},{"class":80,"line":1241},42,[1243,1247,1251,1255,1259,1263,1267,1271],{"type":44,"tag":78,"props":1244,"children":1245},{"style":85},[1246],{"type":49,"value":1089},{"type":44,"tag":78,"props":1248,"children":1249},{"style":216},[1250],{"type":49,"value":342},{"type":44,"tag":78,"props":1252,"children":1253},{"style":195},[1254],{"type":49,"value":1098},{"type":44,"tag":78,"props":1256,"children":1257},{"style":97},[1258],{"type":49,"value":847},{"type":44,"tag":78,"props":1260,"children":1261},{"style":91},[1262],{"type":49,"value":1108},{"type":44,"tag":78,"props":1264,"children":1265},{"style":97},[1266],{"type":49,"value":596},{"type":44,"tag":78,"props":1268,"children":1269},{"style":216},[1270],{"type":49,"value":748},{"type":44,"tag":78,"props":1272,"children":1273},{"style":91},[1274],{"type":49,"value":753},{"type":44,"tag":78,"props":1276,"children":1278},{"class":80,"line":1277},43,[1279,1284],{"type":44,"tag":78,"props":1280,"children":1281},{"style":275},[1282],{"type":49,"value":1283},"            begin",{"type":44,"tag":78,"props":1285,"children":1286},{"style":216},[1287],{"type":49,"value":816},{"type":44,"tag":78,"props":1289,"children":1291},{"class":80,"line":1290},44,[1292,1296,1300,1304,1308,1312,1316,1320,1324,1328,1332,1336,1340,1344,1348,1352,1356,1360,1364,1368,1372,1376],{"type":44,"tag":78,"props":1293,"children":1294},{"style":275},[1295],{"type":49,"value":1129},{"type":44,"tag":78,"props":1297,"children":1298},{"style":216},[1299],{"type":49,"value":682},{"type":44,"tag":78,"props":1301,"children":1302},{"style":91},[1303],{"type":49,"value":834},{"type":44,"tag":78,"props":1305,"children":1306},{"style":216},[1307],{"type":49,"value":139},{"type":44,"tag":78,"props":1309,"children":1310},{"style":91},[1311],{"type":49,"value":224},{"type":44,"tag":78,"props":1313,"children":1314},{"style":97},[1315],{"type":49,"value":847},{"type":44,"tag":78,"props":1317,"children":1318},{"style":91},[1319],{"type":49,"value":449},{"type":44,"tag":78,"props":1321,"children":1322},{"style":97},[1323],{"type":49,"value":856},{"type":44,"tag":78,"props":1325,"children":1326},{"style":91},[1327],{"type":49,"value":153},{"type":44,"tag":78,"props":1329,"children":1330},{"style":216},[1331],{"type":49,"value":865},{"type":44,"tag":78,"props":1333,"children":1334},{"style":91},[1335],{"type":49,"value":224},{"type":44,"tag":78,"props":1337,"children":1338},{"style":97},[1339],{"type":49,"value":847},{"type":44,"tag":78,"props":1341,"children":1342},{"style":91},[1343],{"type":49,"value":449},{"type":44,"tag":78,"props":1345,"children":1346},{"style":97},[1347],{"type":49,"value":882},{"type":44,"tag":78,"props":1349,"children":1350},{"style":91},[1351],{"type":49,"value":153},{"type":44,"tag":78,"props":1353,"children":1354},{"style":216},[1355],{"type":49,"value":891},{"type":44,"tag":78,"props":1357,"children":1358},{"style":91},[1359],{"type":49,"value":224},{"type":44,"tag":78,"props":1361,"children":1362},{"style":97},[1363],{"type":49,"value":847},{"type":44,"tag":78,"props":1365,"children":1366},{"style":91},[1367],{"type":49,"value":449},{"type":44,"tag":78,"props":1369,"children":1370},{"style":97},[1371],{"type":49,"value":908},{"type":44,"tag":78,"props":1373,"children":1374},{"style":91},[1375],{"type":49,"value":105},{"type":44,"tag":78,"props":1377,"children":1378},{"style":216},[1379],{"type":49,"value":784},{"type":44,"tag":78,"props":1381,"children":1383},{"class":80,"line":1382},45,[1384,1389],{"type":44,"tag":78,"props":1385,"children":1386},{"style":275},[1387],{"type":49,"value":1388},"            commit",{"type":44,"tag":78,"props":1390,"children":1391},{"style":216},[1392],{"type":49,"value":816},{"type":44,"tag":78,"props":1394,"children":1396},{"class":80,"line":1395},46,[1397],{"type":44,"tag":78,"props":1398,"children":1399},{"style":91},[1400],{"type":49,"value":802},{"type":44,"tag":78,"props":1402,"children":1404},{"class":80,"line":1403},47,[1405],{"type":44,"tag":78,"props":1406,"children":1407},{"emptyLinePlaceholder":185},[1408],{"type":49,"value":188},{"type":44,"tag":78,"props":1410,"children":1412},{"class":80,"line":1411},48,[1413],{"type":44,"tag":78,"props":1414,"children":1415},{"style":643},[1416],{"type":49,"value":1417},"          \u002F\u002F 4. Signal readiness\n",{"type":44,"tag":78,"props":1419,"children":1421},{"class":80,"line":1420},49,[1422,1427],{"type":44,"tag":78,"props":1423,"children":1424},{"style":275},[1425],{"type":49,"value":1426},"          markReady",{"type":44,"tag":78,"props":1428,"children":1429},{"style":216},[1430],{"type":49,"value":816},{"type":44,"tag":78,"props":1432,"children":1434},{"class":80,"line":1433},50,[1435,1439],{"type":44,"tag":78,"props":1436,"children":1437},{"style":91},[1438],{"type":49,"value":938},{"type":44,"tag":78,"props":1440,"children":1441},{"style":216},[1442],{"type":49,"value":784},{"type":44,"tag":78,"props":1444,"children":1446},{"class":80,"line":1445},51,[1447],{"type":44,"tag":78,"props":1448,"children":1449},{"emptyLinePlaceholder":185},[1450],{"type":49,"value":188},{"type":44,"tag":78,"props":1452,"children":1454},{"class":80,"line":1453},52,[1455],{"type":44,"tag":78,"props":1456,"children":1457},{"style":643},[1458],{"type":49,"value":1459},"        \u002F\u002F 5. Return cleanup function\n",{"type":44,"tag":78,"props":1461,"children":1463},{"class":80,"line":1462},53,[1464,1469,1474,1478],{"type":44,"tag":78,"props":1465,"children":1466},{"style":85},[1467],{"type":49,"value":1468},"        return",{"type":44,"tag":78,"props":1470,"children":1471},{"style":91},[1472],{"type":49,"value":1473}," ()",{"type":44,"tag":78,"props":1475,"children":1476},{"style":195},[1477],{"type":49,"value":366},{"type":44,"tag":78,"props":1479,"children":1480},{"style":91},[1481],{"type":49,"value":209},{"type":44,"tag":78,"props":1483,"children":1485},{"class":80,"line":1484},54,[1486,1491],{"type":44,"tag":78,"props":1487,"children":1488},{"style":275},[1489],{"type":49,"value":1490},"          unsubscribe",{"type":44,"tag":78,"props":1492,"children":1493},{"style":216},[1494],{"type":49,"value":816},{"type":44,"tag":78,"props":1496,"children":1498},{"class":80,"line":1497},55,[1499],{"type":44,"tag":78,"props":1500,"children":1501},{"style":91},[1502],{"type":49,"value":1503},"        }\n",{"type":44,"tag":78,"props":1505,"children":1507},{"class":80,"line":1506},56,[1508],{"type":44,"tag":78,"props":1509,"children":1510},{"style":91},[1511],{"type":49,"value":1512},"      },\n",{"type":44,"tag":78,"props":1514,"children":1516},{"class":80,"line":1515},57,[1517,1522,1526,1530,1535,1539],{"type":44,"tag":78,"props":1518,"children":1519},{"style":216},[1520],{"type":49,"value":1521},"      rowUpdateMode",{"type":44,"tag":78,"props":1523,"children":1524},{"style":91},[1525],{"type":49,"value":224},{"type":44,"tag":78,"props":1527,"children":1528},{"style":91},[1529],{"type":49,"value":115},{"type":44,"tag":78,"props":1531,"children":1532},{"style":118},[1533],{"type":49,"value":1534},"partial",{"type":44,"tag":78,"props":1536,"children":1537},{"style":91},[1538],{"type":49,"value":1159},{"type":44,"tag":78,"props":1540,"children":1541},{"style":91},[1542],{"type":49,"value":459},{"type":44,"tag":78,"props":1544,"children":1546},{"class":80,"line":1545},58,[1547],{"type":44,"tag":78,"props":1548,"children":1549},{"style":91},[1550],{"type":49,"value":1551},"    },\n",{"type":44,"tag":78,"props":1553,"children":1555},{"class":80,"line":1554},59,[1556,1561,1565,1570,1574,1579,1583,1587],{"type":44,"tag":78,"props":1557,"children":1558},{"style":275},[1559],{"type":49,"value":1560},"    onInsert",{"type":44,"tag":78,"props":1562,"children":1563},{"style":91},[1564],{"type":49,"value":224},{"type":44,"tag":78,"props":1566,"children":1567},{"style":195},[1568],{"type":49,"value":1569}," async",{"type":44,"tag":78,"props":1571,"children":1572},{"style":91},[1573],{"type":49,"value":494},{"type":44,"tag":78,"props":1575,"children":1576},{"style":296},[1577],{"type":49,"value":1578}," transaction",{"type":44,"tag":78,"props":1580,"children":1581},{"style":91},[1582],{"type":49,"value":549},{"type":44,"tag":78,"props":1584,"children":1585},{"style":195},[1586],{"type":49,"value":366},{"type":44,"tag":78,"props":1588,"children":1589},{"style":91},[1590],{"type":49,"value":209},{"type":44,"tag":78,"props":1592,"children":1594},{"class":80,"line":1593},60,[1595,1600,1605,1609,1613,1617,1621,1625],{"type":44,"tag":78,"props":1596,"children":1597},{"style":85},[1598],{"type":49,"value":1599},"      await",{"type":44,"tag":78,"props":1601,"children":1602},{"style":275},[1603],{"type":49,"value":1604}," fetch",{"type":44,"tag":78,"props":1606,"children":1607},{"style":216},[1608],{"type":49,"value":682},{"type":44,"tag":78,"props":1610,"children":1611},{"style":97},[1612],{"type":49,"value":299},{"type":44,"tag":78,"props":1614,"children":1615},{"style":91},[1616],{"type":49,"value":449},{"type":44,"tag":78,"props":1618,"children":1619},{"style":97},[1620],{"type":49,"value":695},{"type":44,"tag":78,"props":1622,"children":1623},{"style":91},[1624],{"type":49,"value":153},{"type":44,"tag":78,"props":1626,"children":1627},{"style":91},[1628],{"type":49,"value":209},{"type":44,"tag":78,"props":1630,"children":1632},{"class":80,"line":1631},61,[1633,1638,1642,1646,1651,1655],{"type":44,"tag":78,"props":1634,"children":1635},{"style":216},[1636],{"type":49,"value":1637},"        method",{"type":44,"tag":78,"props":1639,"children":1640},{"style":91},[1641],{"type":49,"value":224},{"type":44,"tag":78,"props":1643,"children":1644},{"style":91},[1645],{"type":49,"value":115},{"type":44,"tag":78,"props":1647,"children":1648},{"style":118},[1649],{"type":49,"value":1650},"POST",{"type":44,"tag":78,"props":1652,"children":1653},{"style":91},[1654],{"type":49,"value":1159},{"type":44,"tag":78,"props":1656,"children":1657},{"style":91},[1658],{"type":49,"value":459},{"type":44,"tag":78,"props":1660,"children":1662},{"class":80,"line":1661},62,[1663,1668,1672,1677,1681,1686,1690,1695,1699,1704,1709,1715,1720,1724,1729,1733],{"type":44,"tag":78,"props":1664,"children":1665},{"style":216},[1666],{"type":49,"value":1667},"        body",{"type":44,"tag":78,"props":1669,"children":1670},{"style":91},[1671],{"type":49,"value":224},{"type":44,"tag":78,"props":1673,"children":1674},{"style":97},[1675],{"type":49,"value":1676}," JSON",{"type":44,"tag":78,"props":1678,"children":1679},{"style":91},[1680],{"type":49,"value":449},{"type":44,"tag":78,"props":1682,"children":1683},{"style":275},[1684],{"type":49,"value":1685},"stringify",{"type":44,"tag":78,"props":1687,"children":1688},{"style":216},[1689],{"type":49,"value":682},{"type":44,"tag":78,"props":1691,"children":1692},{"style":97},[1693],{"type":49,"value":1694},"transaction",{"type":44,"tag":78,"props":1696,"children":1697},{"style":91},[1698],{"type":49,"value":449},{"type":44,"tag":78,"props":1700,"children":1701},{"style":97},[1702],{"type":49,"value":1703},"mutations",{"type":44,"tag":78,"props":1705,"children":1706},{"style":216},[1707],{"type":49,"value":1708},"[",{"type":44,"tag":78,"props":1710,"children":1712},{"style":1711},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[1713],{"type":49,"value":1714},"0",{"type":44,"tag":78,"props":1716,"children":1717},{"style":216},[1718],{"type":49,"value":1719},"]",{"type":44,"tag":78,"props":1721,"children":1722},{"style":91},[1723],{"type":49,"value":449},{"type":44,"tag":78,"props":1725,"children":1726},{"style":97},[1727],{"type":49,"value":1728},"modified",{"type":44,"tag":78,"props":1730,"children":1731},{"style":216},[1732],{"type":49,"value":361},{"type":44,"tag":78,"props":1734,"children":1735},{"style":91},[1736],{"type":49,"value":459},{"type":44,"tag":78,"props":1738,"children":1740},{"class":80,"line":1739},63,[1741,1746],{"type":44,"tag":78,"props":1742,"children":1743},{"style":91},[1744],{"type":49,"value":1745},"      }",{"type":44,"tag":78,"props":1747,"children":1748},{"style":216},[1749],{"type":49,"value":784},{"type":44,"tag":78,"props":1751,"children":1753},{"class":80,"line":1752},64,[1754],{"type":44,"tag":78,"props":1755,"children":1756},{"style":91},[1757],{"type":49,"value":1551},{"type":44,"tag":78,"props":1759,"children":1761},{"class":80,"line":1760},65,[1762,1767,1771,1775,1779,1783,1787,1791],{"type":44,"tag":78,"props":1763,"children":1764},{"style":275},[1765],{"type":49,"value":1766},"    onUpdate",{"type":44,"tag":78,"props":1768,"children":1769},{"style":91},[1770],{"type":49,"value":224},{"type":44,"tag":78,"props":1772,"children":1773},{"style":195},[1774],{"type":49,"value":1569},{"type":44,"tag":78,"props":1776,"children":1777},{"style":91},[1778],{"type":49,"value":494},{"type":44,"tag":78,"props":1780,"children":1781},{"style":296},[1782],{"type":49,"value":1578},{"type":44,"tag":78,"props":1784,"children":1785},{"style":91},[1786],{"type":49,"value":549},{"type":44,"tag":78,"props":1788,"children":1789},{"style":195},[1790],{"type":49,"value":366},{"type":44,"tag":78,"props":1792,"children":1793},{"style":91},[1794],{"type":49,"value":209},{"type":44,"tag":78,"props":1796,"children":1798},{"class":80,"line":1797},66,[1799,1804,1809,1813,1817,1821,1825,1829,1833],{"type":44,"tag":78,"props":1800,"children":1801},{"style":195},[1802],{"type":49,"value":1803},"      const",{"type":44,"tag":78,"props":1805,"children":1806},{"style":97},[1807],{"type":49,"value":1808}," mut",{"type":44,"tag":78,"props":1810,"children":1811},{"style":91},[1812],{"type":49,"value":576},{"type":44,"tag":78,"props":1814,"children":1815},{"style":97},[1816],{"type":49,"value":1578},{"type":44,"tag":78,"props":1818,"children":1819},{"style":91},[1820],{"type":49,"value":449},{"type":44,"tag":78,"props":1822,"children":1823},{"style":97},[1824],{"type":49,"value":1703},{"type":44,"tag":78,"props":1826,"children":1827},{"style":216},[1828],{"type":49,"value":1708},{"type":44,"tag":78,"props":1830,"children":1831},{"style":1711},[1832],{"type":49,"value":1714},{"type":44,"tag":78,"props":1834,"children":1835},{"style":216},[1836],{"type":49,"value":1837},"]\n",{"type":44,"tag":78,"props":1839,"children":1841},{"class":80,"line":1840},67,[1842,1846,1850,1854,1859,1863,1867,1871,1876,1881,1886,1891,1895,1900,1905,1909],{"type":44,"tag":78,"props":1843,"children":1844},{"style":85},[1845],{"type":49,"value":1599},{"type":44,"tag":78,"props":1847,"children":1848},{"style":275},[1849],{"type":49,"value":1604},{"type":44,"tag":78,"props":1851,"children":1852},{"style":216},[1853],{"type":49,"value":682},{"type":44,"tag":78,"props":1855,"children":1856},{"style":91},[1857],{"type":49,"value":1858},"`${",{"type":44,"tag":78,"props":1860,"children":1861},{"style":97},[1862],{"type":49,"value":299},{"type":44,"tag":78,"props":1864,"children":1865},{"style":91},[1866],{"type":49,"value":449},{"type":44,"tag":78,"props":1868,"children":1869},{"style":97},[1870],{"type":49,"value":695},{"type":44,"tag":78,"props":1872,"children":1873},{"style":91},[1874],{"type":49,"value":1875},"}",{"type":44,"tag":78,"props":1877,"children":1878},{"style":118},[1879],{"type":49,"value":1880},"\u002F",{"type":44,"tag":78,"props":1882,"children":1883},{"style":91},[1884],{"type":49,"value":1885},"${",{"type":44,"tag":78,"props":1887,"children":1888},{"style":97},[1889],{"type":49,"value":1890},"mut",{"type":44,"tag":78,"props":1892,"children":1893},{"style":91},[1894],{"type":49,"value":449},{"type":44,"tag":78,"props":1896,"children":1897},{"style":97},[1898],{"type":49,"value":1899},"key",{"type":44,"tag":78,"props":1901,"children":1902},{"style":91},[1903],{"type":49,"value":1904},"}`",{"type":44,"tag":78,"props":1906,"children":1907},{"style":91},[1908],{"type":49,"value":153},{"type":44,"tag":78,"props":1910,"children":1911},{"style":91},[1912],{"type":49,"value":209},{"type":44,"tag":78,"props":1914,"children":1916},{"class":80,"line":1915},68,[1917,1921,1925,1929,1934,1938],{"type":44,"tag":78,"props":1918,"children":1919},{"style":216},[1920],{"type":49,"value":1637},{"type":44,"tag":78,"props":1922,"children":1923},{"style":91},[1924],{"type":49,"value":224},{"type":44,"tag":78,"props":1926,"children":1927},{"style":91},[1928],{"type":49,"value":115},{"type":44,"tag":78,"props":1930,"children":1931},{"style":118},[1932],{"type":49,"value":1933},"PATCH",{"type":44,"tag":78,"props":1935,"children":1936},{"style":91},[1937],{"type":49,"value":1159},{"type":44,"tag":78,"props":1939,"children":1940},{"style":91},[1941],{"type":49,"value":459},{"type":44,"tag":78,"props":1943,"children":1945},{"class":80,"line":1944},69,[1946,1950,1954,1958,1962,1966,1970,1974,1978,1983,1987],{"type":44,"tag":78,"props":1947,"children":1948},{"style":216},[1949],{"type":49,"value":1667},{"type":44,"tag":78,"props":1951,"children":1952},{"style":91},[1953],{"type":49,"value":224},{"type":44,"tag":78,"props":1955,"children":1956},{"style":97},[1957],{"type":49,"value":1676},{"type":44,"tag":78,"props":1959,"children":1960},{"style":91},[1961],{"type":49,"value":449},{"type":44,"tag":78,"props":1963,"children":1964},{"style":275},[1965],{"type":49,"value":1685},{"type":44,"tag":78,"props":1967,"children":1968},{"style":216},[1969],{"type":49,"value":682},{"type":44,"tag":78,"props":1971,"children":1972},{"style":97},[1973],{"type":49,"value":1890},{"type":44,"tag":78,"props":1975,"children":1976},{"style":91},[1977],{"type":49,"value":449},{"type":44,"tag":78,"props":1979,"children":1980},{"style":97},[1981],{"type":49,"value":1982},"changes",{"type":44,"tag":78,"props":1984,"children":1985},{"style":216},[1986],{"type":49,"value":361},{"type":44,"tag":78,"props":1988,"children":1989},{"style":91},[1990],{"type":49,"value":459},{"type":44,"tag":78,"props":1992,"children":1994},{"class":80,"line":1993},70,[1995,1999],{"type":44,"tag":78,"props":1996,"children":1997},{"style":91},[1998],{"type":49,"value":1745},{"type":44,"tag":78,"props":2000,"children":2001},{"style":216},[2002],{"type":49,"value":784},{"type":44,"tag":78,"props":2004,"children":2006},{"class":80,"line":2005},71,[2007],{"type":44,"tag":78,"props":2008,"children":2009},{"style":91},[2010],{"type":49,"value":1551},{"type":44,"tag":78,"props":2012,"children":2014},{"class":80,"line":2013},72,[2015,2020,2024,2028,2032,2036,2040,2044],{"type":44,"tag":78,"props":2016,"children":2017},{"style":275},[2018],{"type":49,"value":2019},"    onDelete",{"type":44,"tag":78,"props":2021,"children":2022},{"style":91},[2023],{"type":49,"value":224},{"type":44,"tag":78,"props":2025,"children":2026},{"style":195},[2027],{"type":49,"value":1569},{"type":44,"tag":78,"props":2029,"children":2030},{"style":91},[2031],{"type":49,"value":494},{"type":44,"tag":78,"props":2033,"children":2034},{"style":296},[2035],{"type":49,"value":1578},{"type":44,"tag":78,"props":2037,"children":2038},{"style":91},[2039],{"type":49,"value":549},{"type":44,"tag":78,"props":2041,"children":2042},{"style":195},[2043],{"type":49,"value":366},{"type":44,"tag":78,"props":2045,"children":2046},{"style":91},[2047],{"type":49,"value":209},{"type":44,"tag":78,"props":2049,"children":2051},{"class":80,"line":2050},73,[2052,2056,2060,2064,2068,2072,2076,2080,2084,2088,2092,2096,2100,2105,2109,2113,2117,2121,2125,2129],{"type":44,"tag":78,"props":2053,"children":2054},{"style":85},[2055],{"type":49,"value":1599},{"type":44,"tag":78,"props":2057,"children":2058},{"style":275},[2059],{"type":49,"value":1604},{"type":44,"tag":78,"props":2061,"children":2062},{"style":216},[2063],{"type":49,"value":682},{"type":44,"tag":78,"props":2065,"children":2066},{"style":91},[2067],{"type":49,"value":1858},{"type":44,"tag":78,"props":2069,"children":2070},{"style":97},[2071],{"type":49,"value":299},{"type":44,"tag":78,"props":2073,"children":2074},{"style":91},[2075],{"type":49,"value":449},{"type":44,"tag":78,"props":2077,"children":2078},{"style":97},[2079],{"type":49,"value":695},{"type":44,"tag":78,"props":2081,"children":2082},{"style":91},[2083],{"type":49,"value":1875},{"type":44,"tag":78,"props":2085,"children":2086},{"style":118},[2087],{"type":49,"value":1880},{"type":44,"tag":78,"props":2089,"children":2090},{"style":91},[2091],{"type":49,"value":1885},{"type":44,"tag":78,"props":2093,"children":2094},{"style":97},[2095],{"type":49,"value":1694},{"type":44,"tag":78,"props":2097,"children":2098},{"style":91},[2099],{"type":49,"value":449},{"type":44,"tag":78,"props":2101,"children":2102},{"style":97},[2103],{"type":49,"value":2104},"mutations[",{"type":44,"tag":78,"props":2106,"children":2107},{"style":1711},[2108],{"type":49,"value":1714},{"type":44,"tag":78,"props":2110,"children":2111},{"style":97},[2112],{"type":49,"value":1719},{"type":44,"tag":78,"props":2114,"children":2115},{"style":91},[2116],{"type":49,"value":449},{"type":44,"tag":78,"props":2118,"children":2119},{"style":97},[2120],{"type":49,"value":1899},{"type":44,"tag":78,"props":2122,"children":2123},{"style":91},[2124],{"type":49,"value":1904},{"type":44,"tag":78,"props":2126,"children":2127},{"style":91},[2128],{"type":49,"value":153},{"type":44,"tag":78,"props":2130,"children":2131},{"style":91},[2132],{"type":49,"value":209},{"type":44,"tag":78,"props":2134,"children":2136},{"class":80,"line":2135},74,[2137,2141,2145,2149,2154,2158],{"type":44,"tag":78,"props":2138,"children":2139},{"style":216},[2140],{"type":49,"value":1637},{"type":44,"tag":78,"props":2142,"children":2143},{"style":91},[2144],{"type":49,"value":224},{"type":44,"tag":78,"props":2146,"children":2147},{"style":91},[2148],{"type":49,"value":115},{"type":44,"tag":78,"props":2150,"children":2151},{"style":118},[2152],{"type":49,"value":2153},"DELETE",{"type":44,"tag":78,"props":2155,"children":2156},{"style":91},[2157],{"type":49,"value":1159},{"type":44,"tag":78,"props":2159,"children":2160},{"style":91},[2161],{"type":49,"value":459},{"type":44,"tag":78,"props":2163,"children":2165},{"class":80,"line":2164},75,[2166,2170],{"type":44,"tag":78,"props":2167,"children":2168},{"style":91},[2169],{"type":49,"value":1745},{"type":44,"tag":78,"props":2171,"children":2172},{"style":216},[2173],{"type":49,"value":784},{"type":44,"tag":78,"props":2175,"children":2177},{"class":80,"line":2176},76,[2178],{"type":44,"tag":78,"props":2179,"children":2180},{"style":91},[2181],{"type":49,"value":1551},{"type":44,"tag":78,"props":2183,"children":2185},{"class":80,"line":2184},77,[2186],{"type":44,"tag":78,"props":2187,"children":2188},{"style":91},[2189],{"type":49,"value":2190},"  }\n",{"type":44,"tag":78,"props":2192,"children":2194},{"class":80,"line":2193},78,[2195],{"type":44,"tag":78,"props":2196,"children":2197},{"style":91},[2198],{"type":49,"value":255},{"type":44,"tag":59,"props":2200,"children":2202},{"id":2201},"core-patterns",[2203],{"type":49,"value":2204},"Core Patterns",{"type":44,"tag":2206,"props":2207,"children":2209},"h3",{"id":2208},"changemessage-format",[2210],{"type":49,"value":2211},"ChangeMessage format",{"type":44,"tag":66,"props":2213,"children":2215},{"className":68,"code":2214,"language":70,"meta":71,"style":71},"\u002F\u002F Insert\nwrite({ type: 'insert', value: item })\n\n\u002F\u002F Update (partial — only changed fields)\nwrite({ type: 'update', key: itemId, value: partialItem })\n\n\u002F\u002F Update (full row replacement)\nwrite({ type: 'update', key: itemId, value: fullItem })\n\u002F\u002F Set rowUpdateMode: \"full\" in sync config\n\n\u002F\u002F Delete\nwrite({ type: 'delete', key: itemId, value: item })\n",[2216],{"type":44,"tag":74,"props":2217,"children":2218},{"__ignoreMap":71},[2219,2227,2288,2295,2303,2381,2388,2396,2472,2480,2487,2495],{"type":44,"tag":78,"props":2220,"children":2221},{"class":80,"line":81},[2222],{"type":44,"tag":78,"props":2223,"children":2224},{"style":643},[2225],{"type":49,"value":2226},"\u002F\u002F Insert\n",{"type":44,"tag":78,"props":2228,"children":2229},{"class":80,"line":129},[2230,2235,2239,2243,2247,2251,2255,2259,2263,2267,2271,2275,2280,2284],{"type":44,"tag":78,"props":2231,"children":2232},{"style":275},[2233],{"type":49,"value":2234},"write",{"type":44,"tag":78,"props":2236,"children":2237},{"style":97},[2238],{"type":49,"value":682},{"type":44,"tag":78,"props":2240,"children":2241},{"style":91},[2242],{"type":49,"value":834},{"type":44,"tag":78,"props":2244,"children":2245},{"style":216},[2246],{"type":49,"value":139},{"type":44,"tag":78,"props":2248,"children":2249},{"style":91},[2250],{"type":49,"value":224},{"type":44,"tag":78,"props":2252,"children":2253},{"style":91},[2254],{"type":49,"value":115},{"type":44,"tag":78,"props":2256,"children":2257},{"style":118},[2258],{"type":49,"value":1154},{"type":44,"tag":78,"props":2260,"children":2261},{"style":91},[2262],{"type":49,"value":1159},{"type":44,"tag":78,"props":2264,"children":2265},{"style":91},[2266],{"type":49,"value":153},{"type":44,"tag":78,"props":2268,"children":2269},{"style":216},[2270],{"type":49,"value":891},{"type":44,"tag":78,"props":2272,"children":2273},{"style":91},[2274],{"type":49,"value":224},{"type":44,"tag":78,"props":2276,"children":2277},{"style":97},[2278],{"type":49,"value":2279}," item ",{"type":44,"tag":78,"props":2281,"children":2282},{"style":91},[2283],{"type":49,"value":1875},{"type":44,"tag":78,"props":2285,"children":2286},{"style":97},[2287],{"type":49,"value":784},{"type":44,"tag":78,"props":2289,"children":2290},{"class":80,"line":181},[2291],{"type":44,"tag":78,"props":2292,"children":2293},{"emptyLinePlaceholder":185},[2294],{"type":49,"value":188},{"type":44,"tag":78,"props":2296,"children":2297},{"class":80,"line":191},[2298],{"type":44,"tag":78,"props":2299,"children":2300},{"style":643},[2301],{"type":49,"value":2302},"\u002F\u002F Update (partial — only changed fields)\n",{"type":44,"tag":78,"props":2304,"children":2305},{"class":80,"line":212},[2306,2310,2314,2318,2322,2326,2330,2335,2339,2343,2347,2351,2356,2360,2364,2368,2373,2377],{"type":44,"tag":78,"props":2307,"children":2308},{"style":275},[2309],{"type":49,"value":2234},{"type":44,"tag":78,"props":2311,"children":2312},{"style":97},[2313],{"type":49,"value":682},{"type":44,"tag":78,"props":2315,"children":2316},{"style":91},[2317],{"type":49,"value":834},{"type":44,"tag":78,"props":2319,"children":2320},{"style":216},[2321],{"type":49,"value":139},{"type":44,"tag":78,"props":2323,"children":2324},{"style":91},[2325],{"type":49,"value":224},{"type":44,"tag":78,"props":2327,"children":2328},{"style":91},[2329],{"type":49,"value":115},{"type":44,"tag":78,"props":2331,"children":2332},{"style":118},[2333],{"type":49,"value":2334},"update",{"type":44,"tag":78,"props":2336,"children":2337},{"style":91},[2338],{"type":49,"value":1159},{"type":44,"tag":78,"props":2340,"children":2341},{"style":91},[2342],{"type":49,"value":153},{"type":44,"tag":78,"props":2344,"children":2345},{"style":216},[2346],{"type":49,"value":865},{"type":44,"tag":78,"props":2348,"children":2349},{"style":91},[2350],{"type":49,"value":224},{"type":44,"tag":78,"props":2352,"children":2353},{"style":97},[2354],{"type":49,"value":2355}," itemId",{"type":44,"tag":78,"props":2357,"children":2358},{"style":91},[2359],{"type":49,"value":153},{"type":44,"tag":78,"props":2361,"children":2362},{"style":216},[2363],{"type":49,"value":891},{"type":44,"tag":78,"props":2365,"children":2366},{"style":91},[2367],{"type":49,"value":224},{"type":44,"tag":78,"props":2369,"children":2370},{"style":97},[2371],{"type":49,"value":2372}," partialItem ",{"type":44,"tag":78,"props":2374,"children":2375},{"style":91},[2376],{"type":49,"value":1875},{"type":44,"tag":78,"props":2378,"children":2379},{"style":97},[2380],{"type":49,"value":784},{"type":44,"tag":78,"props":2382,"children":2383},{"class":80,"line":232},[2384],{"type":44,"tag":78,"props":2385,"children":2386},{"emptyLinePlaceholder":185},[2387],{"type":49,"value":188},{"type":44,"tag":78,"props":2389,"children":2390},{"class":80,"line":249},[2391],{"type":44,"tag":78,"props":2392,"children":2393},{"style":643},[2394],{"type":49,"value":2395},"\u002F\u002F Update (full row replacement)\n",{"type":44,"tag":78,"props":2397,"children":2398},{"class":80,"line":258},[2399,2403,2407,2411,2415,2419,2423,2427,2431,2435,2439,2443,2447,2451,2455,2459,2464,2468],{"type":44,"tag":78,"props":2400,"children":2401},{"style":275},[2402],{"type":49,"value":2234},{"type":44,"tag":78,"props":2404,"children":2405},{"style":97},[2406],{"type":49,"value":682},{"type":44,"tag":78,"props":2408,"children":2409},{"style":91},[2410],{"type":49,"value":834},{"type":44,"tag":78,"props":2412,"children":2413},{"style":216},[2414],{"type":49,"value":139},{"type":44,"tag":78,"props":2416,"children":2417},{"style":91},[2418],{"type":49,"value":224},{"type":44,"tag":78,"props":2420,"children":2421},{"style":91},[2422],{"type":49,"value":115},{"type":44,"tag":78,"props":2424,"children":2425},{"style":118},[2426],{"type":49,"value":2334},{"type":44,"tag":78,"props":2428,"children":2429},{"style":91},[2430],{"type":49,"value":1159},{"type":44,"tag":78,"props":2432,"children":2433},{"style":91},[2434],{"type":49,"value":153},{"type":44,"tag":78,"props":2436,"children":2437},{"style":216},[2438],{"type":49,"value":865},{"type":44,"tag":78,"props":2440,"children":2441},{"style":91},[2442],{"type":49,"value":224},{"type":44,"tag":78,"props":2444,"children":2445},{"style":97},[2446],{"type":49,"value":2355},{"type":44,"tag":78,"props":2448,"children":2449},{"style":91},[2450],{"type":49,"value":153},{"type":44,"tag":78,"props":2452,"children":2453},{"style":216},[2454],{"type":49,"value":891},{"type":44,"tag":78,"props":2456,"children":2457},{"style":91},[2458],{"type":49,"value":224},{"type":44,"tag":78,"props":2460,"children":2461},{"style":97},[2462],{"type":49,"value":2463}," fullItem ",{"type":44,"tag":78,"props":2465,"children":2466},{"style":91},[2467],{"type":49,"value":1875},{"type":44,"tag":78,"props":2469,"children":2470},{"style":97},[2471],{"type":49,"value":784},{"type":44,"tag":78,"props":2473,"children":2474},{"class":80,"line":266},[2475],{"type":44,"tag":78,"props":2476,"children":2477},{"style":643},[2478],{"type":49,"value":2479},"\u002F\u002F Set rowUpdateMode: \"full\" in sync config\n",{"type":44,"tag":78,"props":2481,"children":2482},{"class":80,"line":310},[2483],{"type":44,"tag":78,"props":2484,"children":2485},{"emptyLinePlaceholder":185},[2486],{"type":49,"value":188},{"type":44,"tag":78,"props":2488,"children":2489},{"class":80,"line":327},[2490],{"type":44,"tag":78,"props":2491,"children":2492},{"style":643},[2493],{"type":49,"value":2494},"\u002F\u002F Delete\n",{"type":44,"tag":78,"props":2496,"children":2497},{"class":80,"line":373},[2498,2502,2506,2510,2514,2518,2522,2527,2531,2535,2539,2543,2547,2551,2555,2559,2563,2567],{"type":44,"tag":78,"props":2499,"children":2500},{"style":275},[2501],{"type":49,"value":2234},{"type":44,"tag":78,"props":2503,"children":2504},{"style":97},[2505],{"type":49,"value":682},{"type":44,"tag":78,"props":2507,"children":2508},{"style":91},[2509],{"type":49,"value":834},{"type":44,"tag":78,"props":2511,"children":2512},{"style":216},[2513],{"type":49,"value":139},{"type":44,"tag":78,"props":2515,"children":2516},{"style":91},[2517],{"type":49,"value":224},{"type":44,"tag":78,"props":2519,"children":2520},{"style":91},[2521],{"type":49,"value":115},{"type":44,"tag":78,"props":2523,"children":2524},{"style":118},[2525],{"type":49,"value":2526},"delete",{"type":44,"tag":78,"props":2528,"children":2529},{"style":91},[2530],{"type":49,"value":1159},{"type":44,"tag":78,"props":2532,"children":2533},{"style":91},[2534],{"type":49,"value":153},{"type":44,"tag":78,"props":2536,"children":2537},{"style":216},[2538],{"type":49,"value":865},{"type":44,"tag":78,"props":2540,"children":2541},{"style":91},[2542],{"type":49,"value":224},{"type":44,"tag":78,"props":2544,"children":2545},{"style":97},[2546],{"type":49,"value":2355},{"type":44,"tag":78,"props":2548,"children":2549},{"style":91},[2550],{"type":49,"value":153},{"type":44,"tag":78,"props":2552,"children":2553},{"style":216},[2554],{"type":49,"value":891},{"type":44,"tag":78,"props":2556,"children":2557},{"style":91},[2558],{"type":49,"value":224},{"type":44,"tag":78,"props":2560,"children":2561},{"style":97},[2562],{"type":49,"value":2279},{"type":44,"tag":78,"props":2564,"children":2565},{"style":91},[2566],{"type":49,"value":1875},{"type":44,"tag":78,"props":2568,"children":2569},{"style":97},[2570],{"type":49,"value":784},{"type":44,"tag":2206,"props":2572,"children":2574},{"id":2573},"on-demand-sync-with-loadsubset",[2575],{"type":49,"value":2576},"On-demand sync with loadSubset",{"type":44,"tag":66,"props":2578,"children":2580},{"className":68,"code":2579,"language":70,"meta":71,"style":71},"import { parseLoadSubsetOptions } from \"@tanstack\u002Fdb\"\n\nsync: {\n  sync: ({ begin, write, commit, markReady }) => {\n    \u002F\u002F Initial sync...\n    markReady()\n    return () => {}\n  },\n  loadSubset: async (options) => {\n    const { filters, sorts, limit, offset } = parseLoadSubsetOptions(options)\n    \u002F\u002F filters: [{ field: ['category'], operator: 'eq', value: 'electronics' }]\n    \u002F\u002F sorts:   [{ field: ['price'], direction: 'asc', nulls: 'last' }]\n    const params = new URLSearchParams()\n    for (const f of filters) {\n      params.set(f.field.join(\".\"), `${f.operator}:${f.value}`)\n    }\n    const res = await fetch(`\u002Fapi\u002Fitems?${params}`)\n    return res.json()\n  },\n}\n",[2581],{"type":44,"tag":74,"props":2582,"children":2583},{"__ignoreMap":71},[2584,2622,2629,2645,2701,2709,2721,2742,2750,2787,2855,2863,2871,2901,2938,3058,3066,3120,3143,3150],{"type":44,"tag":78,"props":2585,"children":2586},{"class":80,"line":81},[2587,2591,2595,2600,2604,2608,2613,2617],{"type":44,"tag":78,"props":2588,"children":2589},{"style":85},[2590],{"type":49,"value":88},{"type":44,"tag":78,"props":2592,"children":2593},{"style":91},[2594],{"type":49,"value":94},{"type":44,"tag":78,"props":2596,"children":2597},{"style":97},[2598],{"type":49,"value":2599}," parseLoadSubsetOptions",{"type":44,"tag":78,"props":2601,"children":2602},{"style":91},[2603],{"type":49,"value":105},{"type":44,"tag":78,"props":2605,"children":2606},{"style":85},[2607],{"type":49,"value":110},{"type":44,"tag":78,"props":2609,"children":2610},{"style":91},[2611],{"type":49,"value":2612}," \"",{"type":44,"tag":78,"props":2614,"children":2615},{"style":118},[2616],{"type":49,"value":121},{"type":44,"tag":78,"props":2618,"children":2619},{"style":91},[2620],{"type":49,"value":2621},"\"\n",{"type":44,"tag":78,"props":2623,"children":2624},{"class":80,"line":129},[2625],{"type":44,"tag":78,"props":2626,"children":2627},{"emptyLinePlaceholder":185},[2628],{"type":49,"value":188},{"type":44,"tag":78,"props":2630,"children":2631},{"class":80,"line":181},[2632,2637,2641],{"type":44,"tag":78,"props":2633,"children":2634},{"style":201},[2635],{"type":49,"value":2636},"sync",{"type":44,"tag":78,"props":2638,"children":2639},{"style":91},[2640],{"type":49,"value":224},{"type":44,"tag":78,"props":2642,"children":2643},{"style":91},[2644],{"type":49,"value":209},{"type":44,"tag":78,"props":2646,"children":2647},{"class":80,"line":191},[2648,2653,2657,2661,2665,2669,2673,2677,2681,2685,2689,2693,2697],{"type":44,"tag":78,"props":2649,"children":2650},{"style":201},[2651],{"type":49,"value":2652},"  sync",{"type":44,"tag":78,"props":2654,"children":2655},{"style":91},[2656],{"type":49,"value":224},{"type":44,"tag":78,"props":2658,"children":2659},{"style":91},[2660],{"type":49,"value":494},{"type":44,"tag":78,"props":2662,"children":2663},{"style":296},[2664],{"type":49,"value":499},{"type":44,"tag":78,"props":2666,"children":2667},{"style":91},[2668],{"type":49,"value":153},{"type":44,"tag":78,"props":2670,"children":2671},{"style":296},[2672],{"type":49,"value":508},{"type":44,"tag":78,"props":2674,"children":2675},{"style":91},[2676],{"type":49,"value":153},{"type":44,"tag":78,"props":2678,"children":2679},{"style":296},[2680],{"type":49,"value":517},{"type":44,"tag":78,"props":2682,"children":2683},{"style":91},[2684],{"type":49,"value":153},{"type":44,"tag":78,"props":2686,"children":2687},{"style":296},[2688],{"type":49,"value":526},{"type":44,"tag":78,"props":2690,"children":2691},{"style":91},[2692],{"type":49,"value":549},{"type":44,"tag":78,"props":2694,"children":2695},{"style":195},[2696],{"type":49,"value":366},{"type":44,"tag":78,"props":2698,"children":2699},{"style":91},[2700],{"type":49,"value":209},{"type":44,"tag":78,"props":2702,"children":2703},{"class":80,"line":212},[2704],{"type":44,"tag":78,"props":2705,"children":2706},{"style":643},[2707],{"type":49,"value":2708},"    \u002F\u002F Initial sync...\n",{"type":44,"tag":78,"props":2710,"children":2711},{"class":80,"line":232},[2712,2717],{"type":44,"tag":78,"props":2713,"children":2714},{"style":275},[2715],{"type":49,"value":2716},"    markReady",{"type":44,"tag":78,"props":2718,"children":2719},{"style":216},[2720],{"type":49,"value":816},{"type":44,"tag":78,"props":2722,"children":2723},{"class":80,"line":249},[2724,2729,2733,2737],{"type":44,"tag":78,"props":2725,"children":2726},{"style":85},[2727],{"type":49,"value":2728},"    return",{"type":44,"tag":78,"props":2730,"children":2731},{"style":91},[2732],{"type":49,"value":1473},{"type":44,"tag":78,"props":2734,"children":2735},{"style":195},[2736],{"type":49,"value":366},{"type":44,"tag":78,"props":2738,"children":2739},{"style":91},[2740],{"type":49,"value":2741}," {}\n",{"type":44,"tag":78,"props":2743,"children":2744},{"class":80,"line":258},[2745],{"type":44,"tag":78,"props":2746,"children":2747},{"style":91},[2748],{"type":49,"value":2749},"  },\n",{"type":44,"tag":78,"props":2751,"children":2752},{"class":80,"line":266},[2753,2758,2762,2766,2770,2775,2779,2783],{"type":44,"tag":78,"props":2754,"children":2755},{"style":201},[2756],{"type":49,"value":2757},"  loadSubset",{"type":44,"tag":78,"props":2759,"children":2760},{"style":91},[2761],{"type":49,"value":224},{"type":44,"tag":78,"props":2763,"children":2764},{"style":195},[2765],{"type":49,"value":1569},{"type":44,"tag":78,"props":2767,"children":2768},{"style":91},[2769],{"type":49,"value":342},{"type":44,"tag":78,"props":2771,"children":2772},{"style":296},[2773],{"type":49,"value":2774},"options",{"type":44,"tag":78,"props":2776,"children":2777},{"style":91},[2778],{"type":49,"value":361},{"type":44,"tag":78,"props":2780,"children":2781},{"style":195},[2782],{"type":49,"value":366},{"type":44,"tag":78,"props":2784,"children":2785},{"style":91},[2786],{"type":49,"value":209},{"type":44,"tag":78,"props":2788,"children":2789},{"class":80,"line":310},[2790,2795,2799,2804,2808,2813,2817,2822,2826,2831,2835,2839,2843,2847,2851],{"type":44,"tag":78,"props":2791,"children":2792},{"style":195},[2793],{"type":49,"value":2794},"    const",{"type":44,"tag":78,"props":2796,"children":2797},{"style":91},[2798],{"type":49,"value":94},{"type":44,"tag":78,"props":2800,"children":2801},{"style":97},[2802],{"type":49,"value":2803}," filters",{"type":44,"tag":78,"props":2805,"children":2806},{"style":91},[2807],{"type":49,"value":153},{"type":44,"tag":78,"props":2809,"children":2810},{"style":97},[2811],{"type":49,"value":2812}," sorts",{"type":44,"tag":78,"props":2814,"children":2815},{"style":91},[2816],{"type":49,"value":153},{"type":44,"tag":78,"props":2818,"children":2819},{"style":97},[2820],{"type":49,"value":2821}," limit",{"type":44,"tag":78,"props":2823,"children":2824},{"style":91},[2825],{"type":49,"value":153},{"type":44,"tag":78,"props":2827,"children":2828},{"style":97},[2829],{"type":49,"value":2830}," offset",{"type":44,"tag":78,"props":2832,"children":2833},{"style":91},[2834],{"type":49,"value":105},{"type":44,"tag":78,"props":2836,"children":2837},{"style":91},[2838],{"type":49,"value":576},{"type":44,"tag":78,"props":2840,"children":2841},{"style":275},[2842],{"type":49,"value":2599},{"type":44,"tag":78,"props":2844,"children":2845},{"style":216},[2846],{"type":49,"value":682},{"type":44,"tag":78,"props":2848,"children":2849},{"style":97},[2850],{"type":49,"value":2774},{"type":44,"tag":78,"props":2852,"children":2853},{"style":216},[2854],{"type":49,"value":784},{"type":44,"tag":78,"props":2856,"children":2857},{"class":80,"line":327},[2858],{"type":44,"tag":78,"props":2859,"children":2860},{"style":643},[2861],{"type":49,"value":2862},"    \u002F\u002F filters: [{ field: ['category'], operator: 'eq', value: 'electronics' }]\n",{"type":44,"tag":78,"props":2864,"children":2865},{"class":80,"line":373},[2866],{"type":44,"tag":78,"props":2867,"children":2868},{"style":643},[2869],{"type":49,"value":2870},"    \u002F\u002F sorts:   [{ field: ['price'], direction: 'asc', nulls: 'last' }]\n",{"type":44,"tag":78,"props":2872,"children":2873},{"class":80,"line":416},[2874,2878,2883,2887,2892,2897],{"type":44,"tag":78,"props":2875,"children":2876},{"style":195},[2877],{"type":49,"value":2794},{"type":44,"tag":78,"props":2879,"children":2880},{"style":97},[2881],{"type":49,"value":2882}," params",{"type":44,"tag":78,"props":2884,"children":2885},{"style":91},[2886],{"type":49,"value":576},{"type":44,"tag":78,"props":2888,"children":2889},{"style":91},[2890],{"type":49,"value":2891}," new",{"type":44,"tag":78,"props":2893,"children":2894},{"style":275},[2895],{"type":49,"value":2896}," URLSearchParams",{"type":44,"tag":78,"props":2898,"children":2899},{"style":216},[2900],{"type":49,"value":816},{"type":44,"tag":78,"props":2902,"children":2903},{"class":80,"line":429},[2904,2909,2913,2917,2922,2926,2930,2934],{"type":44,"tag":78,"props":2905,"children":2906},{"style":85},[2907],{"type":49,"value":2908},"    for",{"type":44,"tag":78,"props":2910,"children":2911},{"style":216},[2912],{"type":49,"value":342},{"type":44,"tag":78,"props":2914,"children":2915},{"style":195},[2916],{"type":49,"value":1098},{"type":44,"tag":78,"props":2918,"children":2919},{"style":97},[2920],{"type":49,"value":2921}," f",{"type":44,"tag":78,"props":2923,"children":2924},{"style":91},[2925],{"type":49,"value":1108},{"type":44,"tag":78,"props":2927,"children":2928},{"style":97},[2929],{"type":49,"value":2803},{"type":44,"tag":78,"props":2931,"children":2932},{"style":216},[2933],{"type":49,"value":748},{"type":44,"tag":78,"props":2935,"children":2936},{"style":91},[2937],{"type":49,"value":753},{"type":44,"tag":78,"props":2939,"children":2940},{"class":80,"line":462},[2941,2946,2950,2955,2959,2964,2968,2973,2977,2982,2986,2991,2995,2999,3003,3007,3012,3016,3020,3025,3029,3033,3037,3041,3045,3050,3054],{"type":44,"tag":78,"props":2942,"children":2943},{"style":97},[2944],{"type":49,"value":2945},"      params",{"type":44,"tag":78,"props":2947,"children":2948},{"style":91},[2949],{"type":49,"value":449},{"type":44,"tag":78,"props":2951,"children":2952},{"style":275},[2953],{"type":49,"value":2954},"set",{"type":44,"tag":78,"props":2956,"children":2957},{"style":216},[2958],{"type":49,"value":682},{"type":44,"tag":78,"props":2960,"children":2961},{"style":97},[2962],{"type":49,"value":2963},"f",{"type":44,"tag":78,"props":2965,"children":2966},{"style":91},[2967],{"type":49,"value":449},{"type":44,"tag":78,"props":2969,"children":2970},{"style":97},[2971],{"type":49,"value":2972},"field",{"type":44,"tag":78,"props":2974,"children":2975},{"style":91},[2976],{"type":49,"value":449},{"type":44,"tag":78,"props":2978,"children":2979},{"style":275},[2980],{"type":49,"value":2981},"join",{"type":44,"tag":78,"props":2983,"children":2984},{"style":216},[2985],{"type":49,"value":682},{"type":44,"tag":78,"props":2987,"children":2988},{"style":91},[2989],{"type":49,"value":2990},"\"",{"type":44,"tag":78,"props":2992,"children":2993},{"style":118},[2994],{"type":49,"value":449},{"type":44,"tag":78,"props":2996,"children":2997},{"style":91},[2998],{"type":49,"value":2990},{"type":44,"tag":78,"props":3000,"children":3001},{"style":216},[3002],{"type":49,"value":361},{"type":44,"tag":78,"props":3004,"children":3005},{"style":91},[3006],{"type":49,"value":153},{"type":44,"tag":78,"props":3008,"children":3009},{"style":91},[3010],{"type":49,"value":3011}," `${",{"type":44,"tag":78,"props":3013,"children":3014},{"style":97},[3015],{"type":49,"value":2963},{"type":44,"tag":78,"props":3017,"children":3018},{"style":91},[3019],{"type":49,"value":449},{"type":44,"tag":78,"props":3021,"children":3022},{"style":97},[3023],{"type":49,"value":3024},"operator",{"type":44,"tag":78,"props":3026,"children":3027},{"style":91},[3028],{"type":49,"value":1875},{"type":44,"tag":78,"props":3030,"children":3031},{"style":118},[3032],{"type":49,"value":224},{"type":44,"tag":78,"props":3034,"children":3035},{"style":91},[3036],{"type":49,"value":1885},{"type":44,"tag":78,"props":3038,"children":3039},{"style":97},[3040],{"type":49,"value":2963},{"type":44,"tag":78,"props":3042,"children":3043},{"style":91},[3044],{"type":49,"value":449},{"type":44,"tag":78,"props":3046,"children":3047},{"style":97},[3048],{"type":49,"value":3049},"value",{"type":44,"tag":78,"props":3051,"children":3052},{"style":91},[3053],{"type":49,"value":1904},{"type":44,"tag":78,"props":3055,"children":3056},{"style":216},[3057],{"type":49,"value":784},{"type":44,"tag":78,"props":3059,"children":3060},{"class":80,"line":479},[3061],{"type":44,"tag":78,"props":3062,"children":3063},{"style":91},[3064],{"type":49,"value":3065},"    }\n",{"type":44,"tag":78,"props":3067,"children":3068},{"class":80,"line":560},[3069,3073,3077,3081,3085,3089,3093,3098,3103,3107,3112,3116],{"type":44,"tag":78,"props":3070,"children":3071},{"style":195},[3072],{"type":49,"value":2794},{"type":44,"tag":78,"props":3074,"children":3075},{"style":97},[3076],{"type":49,"value":1055},{"type":44,"tag":78,"props":3078,"children":3079},{"style":91},[3080],{"type":49,"value":576},{"type":44,"tag":78,"props":3082,"children":3083},{"style":85},[3084],{"type":49,"value":1050},{"type":44,"tag":78,"props":3086,"children":3087},{"style":275},[3088],{"type":49,"value":1604},{"type":44,"tag":78,"props":3090,"children":3091},{"style":216},[3092],{"type":49,"value":682},{"type":44,"tag":78,"props":3094,"children":3095},{"style":91},[3096],{"type":49,"value":3097},"`",{"type":44,"tag":78,"props":3099,"children":3100},{"style":118},[3101],{"type":49,"value":3102},"\u002Fapi\u002Fitems?",{"type":44,"tag":78,"props":3104,"children":3105},{"style":91},[3106],{"type":49,"value":1885},{"type":44,"tag":78,"props":3108,"children":3109},{"style":97},[3110],{"type":49,"value":3111},"params",{"type":44,"tag":78,"props":3113,"children":3114},{"style":91},[3115],{"type":49,"value":1904},{"type":44,"tag":78,"props":3117,"children":3118},{"style":216},[3119],{"type":49,"value":784},{"type":44,"tag":78,"props":3121,"children":3122},{"class":80,"line":585},[3123,3127,3131,3135,3139],{"type":44,"tag":78,"props":3124,"children":3125},{"style":85},[3126],{"type":49,"value":2728},{"type":44,"tag":78,"props":3128,"children":3129},{"style":97},[3130],{"type":49,"value":1055},{"type":44,"tag":78,"props":3132,"children":3133},{"style":91},[3134],{"type":49,"value":449},{"type":44,"tag":78,"props":3136,"children":3137},{"style":275},[3138],{"type":49,"value":1064},{"type":44,"tag":78,"props":3140,"children":3141},{"style":216},[3142],{"type":49,"value":816},{"type":44,"tag":78,"props":3144,"children":3145},{"class":80,"line":631},[3146],{"type":44,"tag":78,"props":3147,"children":3148},{"style":91},[3149],{"type":49,"value":2749},{"type":44,"tag":78,"props":3151,"children":3152},{"class":80,"line":639},[3153],{"type":44,"tag":78,"props":3154,"children":3155},{"style":91},[3156],{"type":49,"value":255},{"type":44,"tag":2206,"props":3158,"children":3160},{"id":3159},"managing-optimistic-state-duration",[3161],{"type":49,"value":3162},"Managing optimistic state duration",{"type":44,"tag":45,"props":3164,"children":3165},{},[3166],{"type":49,"value":3167},"Mutation handlers must not resolve until server changes have synced back to the collection. Five strategies:",{"type":44,"tag":3169,"props":3170,"children":3171},"ol",{},[3172,3190,3208,3218,3228],{"type":44,"tag":3173,"props":3174,"children":3175},"li",{},[3176,3182,3184],{"type":44,"tag":3177,"props":3178,"children":3179},"strong",{},[3180],{"type":49,"value":3181},"Refetch",{"type":49,"value":3183}," (simplest): ",{"type":44,"tag":74,"props":3185,"children":3187},{"className":3186},[],[3188],{"type":49,"value":3189},"await collection.utils.refetch()",{"type":44,"tag":3173,"props":3191,"children":3192},{},[3193,3198,3200,3206],{"type":44,"tag":3177,"props":3194,"children":3195},{},[3196],{"type":49,"value":3197},"Transaction ID",{"type":49,"value":3199},": return ",{"type":44,"tag":74,"props":3201,"children":3203},{"className":3202},[],[3204],{"type":49,"value":3205},"{ txid }",{"type":49,"value":3207}," and track via sync stream",{"type":44,"tag":3173,"props":3209,"children":3210},{},[3211,3216],{"type":44,"tag":3177,"props":3212,"children":3213},{},[3214],{"type":49,"value":3215},"ID-based tracking",{"type":49,"value":3217},": await specific record ID appearing in sync stream",{"type":44,"tag":3173,"props":3219,"children":3220},{},[3221,3226],{"type":44,"tag":3177,"props":3222,"children":3223},{},[3224],{"type":49,"value":3225},"Version\u002Ftimestamp",{"type":49,"value":3227},": wait until sync stream catches up to mutation time",{"type":44,"tag":3173,"props":3229,"children":3230},{},[3231,3236,3238],{"type":44,"tag":3177,"props":3232,"children":3233},{},[3234],{"type":49,"value":3235},"Provider method",{"type":49,"value":3237},": ",{"type":44,"tag":74,"props":3239,"children":3241},{"className":3240},[],[3242],{"type":49,"value":3243},"await backend.waitForPendingWrites()",{"type":44,"tag":2206,"props":3245,"children":3247},{"id":3246},"persisted-sync-metadata",[3248],{"type":49,"value":3249},"Persisted sync metadata",{"type":44,"tag":45,"props":3251,"children":3252},{},[3253,3255,3261],{"type":49,"value":3254},"The ",{"type":44,"tag":74,"props":3256,"children":3258},{"className":3257},[],[3259],{"type":49,"value":3260},"metadata",{"type":49,"value":3262}," API on the sync config allows adapters to store per-row and per-collection metadata that persists across sync transactions. This is useful for tracking resume tokens, cursors, LSNs, or other adapter-specific state.",{"type":44,"tag":45,"props":3264,"children":3265},{},[3266,3267,3272,3274,3280,3282,3287,3288,3294],{"type":49,"value":3254},{"type":44,"tag":74,"props":3268,"children":3270},{"className":3269},[],[3271],{"type":49,"value":3260},{"type":49,"value":3273}," object is available as a property on the sync config argument alongside ",{"type":44,"tag":74,"props":3275,"children":3277},{"className":3276},[],[3278],{"type":49,"value":3279},"begin",{"type":49,"value":3281},", ",{"type":44,"tag":74,"props":3283,"children":3285},{"className":3284},[],[3286],{"type":49,"value":2234},{"type":49,"value":3281},{"type":44,"tag":74,"props":3289,"children":3291},{"className":3290},[],[3292],{"type":49,"value":3293},"commit",{"type":49,"value":3295},", etc. It is always provided, but without persistence the metadata is in-memory only and does not survive reloads. With persistence, metadata is durable across sessions.",{"type":44,"tag":66,"props":3297,"children":3299},{"className":68,"code":3298,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit, markReady, metadata }) => {\n  \u002F\u002F Row metadata: store per-row state (e.g. server version, ETag)\n  metadata.row.get(key) \u002F\u002F => unknown | undefined\n  metadata.row.set(key, { version: 3, etag: 'abc' })\n  metadata.row.delete(key)\n\n  \u002F\u002F Collection metadata: store per-collection state (e.g. resume cursor)\n  metadata.collection.get('cursor') \u002F\u002F => unknown | undefined\n  metadata.collection.set('cursor', 'token_abc123')\n  metadata.collection.delete('cursor')\n  metadata.collection.list() \u002F\u002F => [{ key: 'cursor', value: 'token_abc123' }]\n  metadata.collection.list('resume') \u002F\u002F filter by prefix\n}\n",[3300],{"type":44,"tag":74,"props":3301,"children":3302},{"__ignoreMap":71},[3303,3366,3374,3417,3504,3539,3546,3554,3603,3663,3706,3740,3789],{"type":44,"tag":78,"props":3304,"children":3305},{"class":80,"line":81},[3306,3310,3314,3318,3322,3326,3330,3334,3338,3342,3346,3350,3354,3358,3362],{"type":44,"tag":78,"props":3307,"children":3308},{"style":201},[3309],{"type":49,"value":2636},{"type":44,"tag":78,"props":3311,"children":3312},{"style":91},[3313],{"type":49,"value":224},{"type":44,"tag":78,"props":3315,"children":3316},{"style":91},[3317],{"type":49,"value":494},{"type":44,"tag":78,"props":3319,"children":3320},{"style":296},[3321],{"type":49,"value":499},{"type":44,"tag":78,"props":3323,"children":3324},{"style":91},[3325],{"type":49,"value":153},{"type":44,"tag":78,"props":3327,"children":3328},{"style":296},[3329],{"type":49,"value":508},{"type":44,"tag":78,"props":3331,"children":3332},{"style":91},[3333],{"type":49,"value":153},{"type":44,"tag":78,"props":3335,"children":3336},{"style":296},[3337],{"type":49,"value":517},{"type":44,"tag":78,"props":3339,"children":3340},{"style":91},[3341],{"type":49,"value":153},{"type":44,"tag":78,"props":3343,"children":3344},{"style":296},[3345],{"type":49,"value":526},{"type":44,"tag":78,"props":3347,"children":3348},{"style":91},[3349],{"type":49,"value":153},{"type":44,"tag":78,"props":3351,"children":3352},{"style":296},[3353],{"type":49,"value":535},{"type":44,"tag":78,"props":3355,"children":3356},{"style":91},[3357],{"type":49,"value":549},{"type":44,"tag":78,"props":3359,"children":3360},{"style":195},[3361],{"type":49,"value":366},{"type":44,"tag":78,"props":3363,"children":3364},{"style":91},[3365],{"type":49,"value":209},{"type":44,"tag":78,"props":3367,"children":3368},{"class":80,"line":129},[3369],{"type":44,"tag":78,"props":3370,"children":3371},{"style":643},[3372],{"type":49,"value":3373},"  \u002F\u002F Row metadata: store per-row state (e.g. server version, ETag)\n",{"type":44,"tag":78,"props":3375,"children":3376},{"class":80,"line":181},[3377,3382,3386,3391,3395,3400,3404,3408,3412],{"type":44,"tag":78,"props":3378,"children":3379},{"style":97},[3380],{"type":49,"value":3381},"  metadata",{"type":44,"tag":78,"props":3383,"children":3384},{"style":91},[3385],{"type":49,"value":449},{"type":44,"tag":78,"props":3387,"children":3388},{"style":97},[3389],{"type":49,"value":3390},"row",{"type":44,"tag":78,"props":3392,"children":3393},{"style":91},[3394],{"type":49,"value":449},{"type":44,"tag":78,"props":3396,"children":3397},{"style":275},[3398],{"type":49,"value":3399},"get",{"type":44,"tag":78,"props":3401,"children":3402},{"style":216},[3403],{"type":49,"value":682},{"type":44,"tag":78,"props":3405,"children":3406},{"style":97},[3407],{"type":49,"value":1899},{"type":44,"tag":78,"props":3409,"children":3410},{"style":216},[3411],{"type":49,"value":748},{"type":44,"tag":78,"props":3413,"children":3414},{"style":643},[3415],{"type":49,"value":3416},"\u002F\u002F => unknown | undefined\n",{"type":44,"tag":78,"props":3418,"children":3419},{"class":80,"line":191},[3420,3424,3428,3432,3436,3440,3444,3448,3452,3456,3461,3465,3470,3474,3479,3483,3487,3492,3496,3500],{"type":44,"tag":78,"props":3421,"children":3422},{"style":97},[3423],{"type":49,"value":3381},{"type":44,"tag":78,"props":3425,"children":3426},{"style":91},[3427],{"type":49,"value":449},{"type":44,"tag":78,"props":3429,"children":3430},{"style":97},[3431],{"type":49,"value":3390},{"type":44,"tag":78,"props":3433,"children":3434},{"style":91},[3435],{"type":49,"value":449},{"type":44,"tag":78,"props":3437,"children":3438},{"style":275},[3439],{"type":49,"value":2954},{"type":44,"tag":78,"props":3441,"children":3442},{"style":216},[3443],{"type":49,"value":682},{"type":44,"tag":78,"props":3445,"children":3446},{"style":97},[3447],{"type":49,"value":1899},{"type":44,"tag":78,"props":3449,"children":3450},{"style":91},[3451],{"type":49,"value":153},{"type":44,"tag":78,"props":3453,"children":3454},{"style":91},[3455],{"type":49,"value":94},{"type":44,"tag":78,"props":3457,"children":3458},{"style":216},[3459],{"type":49,"value":3460}," version",{"type":44,"tag":78,"props":3462,"children":3463},{"style":91},[3464],{"type":49,"value":224},{"type":44,"tag":78,"props":3466,"children":3467},{"style":1711},[3468],{"type":49,"value":3469}," 3",{"type":44,"tag":78,"props":3471,"children":3472},{"style":91},[3473],{"type":49,"value":153},{"type":44,"tag":78,"props":3475,"children":3476},{"style":216},[3477],{"type":49,"value":3478}," etag",{"type":44,"tag":78,"props":3480,"children":3481},{"style":91},[3482],{"type":49,"value":224},{"type":44,"tag":78,"props":3484,"children":3485},{"style":91},[3486],{"type":49,"value":115},{"type":44,"tag":78,"props":3488,"children":3489},{"style":118},[3490],{"type":49,"value":3491},"abc",{"type":44,"tag":78,"props":3493,"children":3494},{"style":91},[3495],{"type":49,"value":1159},{"type":44,"tag":78,"props":3497,"children":3498},{"style":91},[3499],{"type":49,"value":105},{"type":44,"tag":78,"props":3501,"children":3502},{"style":216},[3503],{"type":49,"value":784},{"type":44,"tag":78,"props":3505,"children":3506},{"class":80,"line":212},[3507,3511,3515,3519,3523,3527,3531,3535],{"type":44,"tag":78,"props":3508,"children":3509},{"style":97},[3510],{"type":49,"value":3381},{"type":44,"tag":78,"props":3512,"children":3513},{"style":91},[3514],{"type":49,"value":449},{"type":44,"tag":78,"props":3516,"children":3517},{"style":97},[3518],{"type":49,"value":3390},{"type":44,"tag":78,"props":3520,"children":3521},{"style":91},[3522],{"type":49,"value":449},{"type":44,"tag":78,"props":3524,"children":3525},{"style":275},[3526],{"type":49,"value":2526},{"type":44,"tag":78,"props":3528,"children":3529},{"style":216},[3530],{"type":49,"value":682},{"type":44,"tag":78,"props":3532,"children":3533},{"style":97},[3534],{"type":49,"value":1899},{"type":44,"tag":78,"props":3536,"children":3537},{"style":216},[3538],{"type":49,"value":784},{"type":44,"tag":78,"props":3540,"children":3541},{"class":80,"line":232},[3542],{"type":44,"tag":78,"props":3543,"children":3544},{"emptyLinePlaceholder":185},[3545],{"type":49,"value":188},{"type":44,"tag":78,"props":3547,"children":3548},{"class":80,"line":249},[3549],{"type":44,"tag":78,"props":3550,"children":3551},{"style":643},[3552],{"type":49,"value":3553},"  \u002F\u002F Collection metadata: store per-collection state (e.g. resume cursor)\n",{"type":44,"tag":78,"props":3555,"children":3556},{"class":80,"line":258},[3557,3561,3565,3570,3574,3578,3582,3586,3591,3595,3599],{"type":44,"tag":78,"props":3558,"children":3559},{"style":97},[3560],{"type":49,"value":3381},{"type":44,"tag":78,"props":3562,"children":3563},{"style":91},[3564],{"type":49,"value":449},{"type":44,"tag":78,"props":3566,"children":3567},{"style":97},[3568],{"type":49,"value":3569},"collection",{"type":44,"tag":78,"props":3571,"children":3572},{"style":91},[3573],{"type":49,"value":449},{"type":44,"tag":78,"props":3575,"children":3576},{"style":275},[3577],{"type":49,"value":3399},{"type":44,"tag":78,"props":3579,"children":3580},{"style":216},[3581],{"type":49,"value":682},{"type":44,"tag":78,"props":3583,"children":3584},{"style":91},[3585],{"type":49,"value":1159},{"type":44,"tag":78,"props":3587,"children":3588},{"style":118},[3589],{"type":49,"value":3590},"cursor",{"type":44,"tag":78,"props":3592,"children":3593},{"style":91},[3594],{"type":49,"value":1159},{"type":44,"tag":78,"props":3596,"children":3597},{"style":216},[3598],{"type":49,"value":748},{"type":44,"tag":78,"props":3600,"children":3601},{"style":643},[3602],{"type":49,"value":3416},{"type":44,"tag":78,"props":3604,"children":3605},{"class":80,"line":266},[3606,3610,3614,3618,3622,3626,3630,3634,3638,3642,3646,3650,3655,3659],{"type":44,"tag":78,"props":3607,"children":3608},{"style":97},[3609],{"type":49,"value":3381},{"type":44,"tag":78,"props":3611,"children":3612},{"style":91},[3613],{"type":49,"value":449},{"type":44,"tag":78,"props":3615,"children":3616},{"style":97},[3617],{"type":49,"value":3569},{"type":44,"tag":78,"props":3619,"children":3620},{"style":91},[3621],{"type":49,"value":449},{"type":44,"tag":78,"props":3623,"children":3624},{"style":275},[3625],{"type":49,"value":2954},{"type":44,"tag":78,"props":3627,"children":3628},{"style":216},[3629],{"type":49,"value":682},{"type":44,"tag":78,"props":3631,"children":3632},{"style":91},[3633],{"type":49,"value":1159},{"type":44,"tag":78,"props":3635,"children":3636},{"style":118},[3637],{"type":49,"value":3590},{"type":44,"tag":78,"props":3639,"children":3640},{"style":91},[3641],{"type":49,"value":1159},{"type":44,"tag":78,"props":3643,"children":3644},{"style":91},[3645],{"type":49,"value":153},{"type":44,"tag":78,"props":3647,"children":3648},{"style":91},[3649],{"type":49,"value":115},{"type":44,"tag":78,"props":3651,"children":3652},{"style":118},[3653],{"type":49,"value":3654},"token_abc123",{"type":44,"tag":78,"props":3656,"children":3657},{"style":91},[3658],{"type":49,"value":1159},{"type":44,"tag":78,"props":3660,"children":3661},{"style":216},[3662],{"type":49,"value":784},{"type":44,"tag":78,"props":3664,"children":3665},{"class":80,"line":310},[3666,3670,3674,3678,3682,3686,3690,3694,3698,3702],{"type":44,"tag":78,"props":3667,"children":3668},{"style":97},[3669],{"type":49,"value":3381},{"type":44,"tag":78,"props":3671,"children":3672},{"style":91},[3673],{"type":49,"value":449},{"type":44,"tag":78,"props":3675,"children":3676},{"style":97},[3677],{"type":49,"value":3569},{"type":44,"tag":78,"props":3679,"children":3680},{"style":91},[3681],{"type":49,"value":449},{"type":44,"tag":78,"props":3683,"children":3684},{"style":275},[3685],{"type":49,"value":2526},{"type":44,"tag":78,"props":3687,"children":3688},{"style":216},[3689],{"type":49,"value":682},{"type":44,"tag":78,"props":3691,"children":3692},{"style":91},[3693],{"type":49,"value":1159},{"type":44,"tag":78,"props":3695,"children":3696},{"style":118},[3697],{"type":49,"value":3590},{"type":44,"tag":78,"props":3699,"children":3700},{"style":91},[3701],{"type":49,"value":1159},{"type":44,"tag":78,"props":3703,"children":3704},{"style":216},[3705],{"type":49,"value":784},{"type":44,"tag":78,"props":3707,"children":3708},{"class":80,"line":327},[3709,3713,3717,3721,3725,3730,3735],{"type":44,"tag":78,"props":3710,"children":3711},{"style":97},[3712],{"type":49,"value":3381},{"type":44,"tag":78,"props":3714,"children":3715},{"style":91},[3716],{"type":49,"value":449},{"type":44,"tag":78,"props":3718,"children":3719},{"style":97},[3720],{"type":49,"value":3569},{"type":44,"tag":78,"props":3722,"children":3723},{"style":91},[3724],{"type":49,"value":449},{"type":44,"tag":78,"props":3726,"children":3727},{"style":275},[3728],{"type":49,"value":3729},"list",{"type":44,"tag":78,"props":3731,"children":3732},{"style":216},[3733],{"type":49,"value":3734},"() ",{"type":44,"tag":78,"props":3736,"children":3737},{"style":643},[3738],{"type":49,"value":3739},"\u002F\u002F => [{ key: 'cursor', value: 'token_abc123' }]\n",{"type":44,"tag":78,"props":3741,"children":3742},{"class":80,"line":373},[3743,3747,3751,3755,3759,3763,3767,3771,3776,3780,3784],{"type":44,"tag":78,"props":3744,"children":3745},{"style":97},[3746],{"type":49,"value":3381},{"type":44,"tag":78,"props":3748,"children":3749},{"style":91},[3750],{"type":49,"value":449},{"type":44,"tag":78,"props":3752,"children":3753},{"style":97},[3754],{"type":49,"value":3569},{"type":44,"tag":78,"props":3756,"children":3757},{"style":91},[3758],{"type":49,"value":449},{"type":44,"tag":78,"props":3760,"children":3761},{"style":275},[3762],{"type":49,"value":3729},{"type":44,"tag":78,"props":3764,"children":3765},{"style":216},[3766],{"type":49,"value":682},{"type":44,"tag":78,"props":3768,"children":3769},{"style":91},[3770],{"type":49,"value":1159},{"type":44,"tag":78,"props":3772,"children":3773},{"style":118},[3774],{"type":49,"value":3775},"resume",{"type":44,"tag":78,"props":3777,"children":3778},{"style":91},[3779],{"type":49,"value":1159},{"type":44,"tag":78,"props":3781,"children":3782},{"style":216},[3783],{"type":49,"value":748},{"type":44,"tag":78,"props":3785,"children":3786},{"style":643},[3787],{"type":49,"value":3788},"\u002F\u002F filter by prefix\n",{"type":44,"tag":78,"props":3790,"children":3791},{"class":80,"line":416},[3792],{"type":44,"tag":78,"props":3793,"children":3794},{"style":91},[3795],{"type":49,"value":255},{"type":44,"tag":45,"props":3797,"children":3798},{},[3799,3801,3807,3809,3815],{"type":49,"value":3800},"Row metadata writes are tied to the current transaction. When a row is deleted via ",{"type":44,"tag":74,"props":3802,"children":3804},{"className":3803},[],[3805],{"type":49,"value":3806},"write({ type: 'delete', ... })",{"type":49,"value":3808},", its row metadata is automatically deleted. When a row is inserted, its metadata is set from ",{"type":44,"tag":74,"props":3810,"children":3812},{"className":3811},[],[3813],{"type":49,"value":3814},"message.metadata",{"type":49,"value":3816}," if provided, or deleted otherwise.",{"type":44,"tag":45,"props":3818,"children":3819},{},[3820,3822,3828],{"type":49,"value":3821},"Collection metadata writes staged before ",{"type":44,"tag":74,"props":3823,"children":3825},{"className":3824},[],[3826],{"type":49,"value":3827},"truncate()",{"type":49,"value":3829}," are preserved and commit atomically with the truncate transaction.",{"type":44,"tag":45,"props":3831,"children":3832},{},[3833],{"type":44,"tag":3177,"props":3834,"children":3835},{},[3836],{"type":49,"value":3837},"Typical usage — resume token:",{"type":44,"tag":66,"props":3839,"children":3841},{"className":68,"code":3840,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit, markReady, metadata }) => {\n  const lastCursor = metadata.collection.get('cursor') as string | undefined\n\n  const stream = subscribeFromCursor(lastCursor)\n  stream.on('data', (batch) => {\n    begin()\n    for (const item of batch.items) {\n      write({ type: item.type, key: item.id, value: item.data })\n    }\n    metadata.collection.set('cursor', batch.cursor)\n    commit()\n  })\n\n  stream.on('ready', () => markReady())\n  return () => stream.close()\n}\n",[3842],{"type":44,"tag":74,"props":3843,"children":3844},{"__ignoreMap":71},[3845,3908,3984,3991,4025,4083,4095,4140,4232,4239,4299,4311,4323,4330,4383,4415],{"type":44,"tag":78,"props":3846,"children":3847},{"class":80,"line":81},[3848,3852,3856,3860,3864,3868,3872,3876,3880,3884,3888,3892,3896,3900,3904],{"type":44,"tag":78,"props":3849,"children":3850},{"style":201},[3851],{"type":49,"value":2636},{"type":44,"tag":78,"props":3853,"children":3854},{"style":91},[3855],{"type":49,"value":224},{"type":44,"tag":78,"props":3857,"children":3858},{"style":91},[3859],{"type":49,"value":494},{"type":44,"tag":78,"props":3861,"children":3862},{"style":296},[3863],{"type":49,"value":499},{"type":44,"tag":78,"props":3865,"children":3866},{"style":91},[3867],{"type":49,"value":153},{"type":44,"tag":78,"props":3869,"children":3870},{"style":296},[3871],{"type":49,"value":508},{"type":44,"tag":78,"props":3873,"children":3874},{"style":91},[3875],{"type":49,"value":153},{"type":44,"tag":78,"props":3877,"children":3878},{"style":296},[3879],{"type":49,"value":517},{"type":44,"tag":78,"props":3881,"children":3882},{"style":91},[3883],{"type":49,"value":153},{"type":44,"tag":78,"props":3885,"children":3886},{"style":296},[3887],{"type":49,"value":526},{"type":44,"tag":78,"props":3889,"children":3890},{"style":91},[3891],{"type":49,"value":153},{"type":44,"tag":78,"props":3893,"children":3894},{"style":296},[3895],{"type":49,"value":535},{"type":44,"tag":78,"props":3897,"children":3898},{"style":91},[3899],{"type":49,"value":549},{"type":44,"tag":78,"props":3901,"children":3902},{"style":195},[3903],{"type":49,"value":366},{"type":44,"tag":78,"props":3905,"children":3906},{"style":91},[3907],{"type":49,"value":209},{"type":44,"tag":78,"props":3909,"children":3910},{"class":80,"line":129},[3911,3916,3921,3925,3929,3933,3937,3941,3945,3949,3953,3957,3961,3965,3970,3974,3979],{"type":44,"tag":78,"props":3912,"children":3913},{"style":195},[3914],{"type":49,"value":3915},"  const",{"type":44,"tag":78,"props":3917,"children":3918},{"style":97},[3919],{"type":49,"value":3920}," lastCursor",{"type":44,"tag":78,"props":3922,"children":3923},{"style":91},[3924],{"type":49,"value":576},{"type":44,"tag":78,"props":3926,"children":3927},{"style":97},[3928],{"type":49,"value":535},{"type":44,"tag":78,"props":3930,"children":3931},{"style":91},[3932],{"type":49,"value":449},{"type":44,"tag":78,"props":3934,"children":3935},{"style":97},[3936],{"type":49,"value":3569},{"type":44,"tag":78,"props":3938,"children":3939},{"style":91},[3940],{"type":49,"value":449},{"type":44,"tag":78,"props":3942,"children":3943},{"style":275},[3944],{"type":49,"value":3399},{"type":44,"tag":78,"props":3946,"children":3947},{"style":216},[3948],{"type":49,"value":682},{"type":44,"tag":78,"props":3950,"children":3951},{"style":91},[3952],{"type":49,"value":1159},{"type":44,"tag":78,"props":3954,"children":3955},{"style":118},[3956],{"type":49,"value":3590},{"type":44,"tag":78,"props":3958,"children":3959},{"style":91},[3960],{"type":49,"value":1159},{"type":44,"tag":78,"props":3962,"children":3963},{"style":216},[3964],{"type":49,"value":748},{"type":44,"tag":78,"props":3966,"children":3967},{"style":85},[3968],{"type":49,"value":3969},"as",{"type":44,"tag":78,"props":3971,"children":3972},{"style":201},[3973],{"type":49,"value":400},{"type":44,"tag":78,"props":3975,"children":3976},{"style":91},[3977],{"type":49,"value":3978}," |",{"type":44,"tag":78,"props":3980,"children":3981},{"style":201},[3982],{"type":49,"value":3983}," undefined\n",{"type":44,"tag":78,"props":3985,"children":3986},{"class":80,"line":181},[3987],{"type":44,"tag":78,"props":3988,"children":3989},{"emptyLinePlaceholder":185},[3990],{"type":49,"value":188},{"type":44,"tag":78,"props":3992,"children":3993},{"class":80,"line":191},[3994,3998,4003,4007,4012,4016,4021],{"type":44,"tag":78,"props":3995,"children":3996},{"style":195},[3997],{"type":49,"value":3915},{"type":44,"tag":78,"props":3999,"children":4000},{"style":97},[4001],{"type":49,"value":4002}," stream",{"type":44,"tag":78,"props":4004,"children":4005},{"style":91},[4006],{"type":49,"value":576},{"type":44,"tag":78,"props":4008,"children":4009},{"style":275},[4010],{"type":49,"value":4011}," subscribeFromCursor",{"type":44,"tag":78,"props":4013,"children":4014},{"style":216},[4015],{"type":49,"value":682},{"type":44,"tag":78,"props":4017,"children":4018},{"style":97},[4019],{"type":49,"value":4020},"lastCursor",{"type":44,"tag":78,"props":4022,"children":4023},{"style":216},[4024],{"type":49,"value":784},{"type":44,"tag":78,"props":4026,"children":4027},{"class":80,"line":212},[4028,4033,4037,4042,4046,4050,4054,4058,4062,4066,4071,4075,4079],{"type":44,"tag":78,"props":4029,"children":4030},{"style":97},[4031],{"type":49,"value":4032},"  stream",{"type":44,"tag":78,"props":4034,"children":4035},{"style":91},[4036],{"type":49,"value":449},{"type":44,"tag":78,"props":4038,"children":4039},{"style":275},[4040],{"type":49,"value":4041},"on",{"type":44,"tag":78,"props":4043,"children":4044},{"style":216},[4045],{"type":49,"value":682},{"type":44,"tag":78,"props":4047,"children":4048},{"style":91},[4049],{"type":49,"value":1159},{"type":44,"tag":78,"props":4051,"children":4052},{"style":118},[4053],{"type":49,"value":908},{"type":44,"tag":78,"props":4055,"children":4056},{"style":91},[4057],{"type":49,"value":1159},{"type":44,"tag":78,"props":4059,"children":4060},{"style":91},[4061],{"type":49,"value":153},{"type":44,"tag":78,"props":4063,"children":4064},{"style":91},[4065],{"type":49,"value":342},{"type":44,"tag":78,"props":4067,"children":4068},{"style":296},[4069],{"type":49,"value":4070},"batch",{"type":44,"tag":78,"props":4072,"children":4073},{"style":91},[4074],{"type":49,"value":361},{"type":44,"tag":78,"props":4076,"children":4077},{"style":195},[4078],{"type":49,"value":366},{"type":44,"tag":78,"props":4080,"children":4081},{"style":91},[4082],{"type":49,"value":209},{"type":44,"tag":78,"props":4084,"children":4085},{"class":80,"line":232},[4086,4091],{"type":44,"tag":78,"props":4087,"children":4088},{"style":275},[4089],{"type":49,"value":4090},"    begin",{"type":44,"tag":78,"props":4092,"children":4093},{"style":216},[4094],{"type":49,"value":816},{"type":44,"tag":78,"props":4096,"children":4097},{"class":80,"line":249},[4098,4102,4106,4110,4114,4118,4123,4127,4132,4136],{"type":44,"tag":78,"props":4099,"children":4100},{"style":85},[4101],{"type":49,"value":2908},{"type":44,"tag":78,"props":4103,"children":4104},{"style":216},[4105],{"type":49,"value":342},{"type":44,"tag":78,"props":4107,"children":4108},{"style":195},[4109],{"type":49,"value":1098},{"type":44,"tag":78,"props":4111,"children":4112},{"style":97},[4113],{"type":49,"value":1103},{"type":44,"tag":78,"props":4115,"children":4116},{"style":91},[4117],{"type":49,"value":1108},{"type":44,"tag":78,"props":4119,"children":4120},{"style":97},[4121],{"type":49,"value":4122}," batch",{"type":44,"tag":78,"props":4124,"children":4125},{"style":91},[4126],{"type":49,"value":449},{"type":44,"tag":78,"props":4128,"children":4129},{"style":97},[4130],{"type":49,"value":4131},"items",{"type":44,"tag":78,"props":4133,"children":4134},{"style":216},[4135],{"type":49,"value":748},{"type":44,"tag":78,"props":4137,"children":4138},{"style":91},[4139],{"type":49,"value":753},{"type":44,"tag":78,"props":4141,"children":4142},{"class":80,"line":258},[4143,4148,4152,4156,4160,4164,4168,4172,4176,4180,4184,4188,4192,4196,4200,4204,4208,4212,4216,4220,4224,4228],{"type":44,"tag":78,"props":4144,"children":4145},{"style":275},[4146],{"type":49,"value":4147},"      write",{"type":44,"tag":78,"props":4149,"children":4150},{"style":216},[4151],{"type":49,"value":682},{"type":44,"tag":78,"props":4153,"children":4154},{"style":91},[4155],{"type":49,"value":834},{"type":44,"tag":78,"props":4157,"children":4158},{"style":216},[4159],{"type":49,"value":139},{"type":44,"tag":78,"props":4161,"children":4162},{"style":91},[4163],{"type":49,"value":224},{"type":44,"tag":78,"props":4165,"children":4166},{"style":97},[4167],{"type":49,"value":1103},{"type":44,"tag":78,"props":4169,"children":4170},{"style":91},[4171],{"type":49,"value":449},{"type":44,"tag":78,"props":4173,"children":4174},{"style":97},[4175],{"type":49,"value":856},{"type":44,"tag":78,"props":4177,"children":4178},{"style":91},[4179],{"type":49,"value":153},{"type":44,"tag":78,"props":4181,"children":4182},{"style":216},[4183],{"type":49,"value":865},{"type":44,"tag":78,"props":4185,"children":4186},{"style":91},[4187],{"type":49,"value":224},{"type":44,"tag":78,"props":4189,"children":4190},{"style":97},[4191],{"type":49,"value":1103},{"type":44,"tag":78,"props":4193,"children":4194},{"style":91},[4195],{"type":49,"value":449},{"type":44,"tag":78,"props":4197,"children":4198},{"style":97},[4199],{"type":49,"value":882},{"type":44,"tag":78,"props":4201,"children":4202},{"style":91},[4203],{"type":49,"value":153},{"type":44,"tag":78,"props":4205,"children":4206},{"style":216},[4207],{"type":49,"value":891},{"type":44,"tag":78,"props":4209,"children":4210},{"style":91},[4211],{"type":49,"value":224},{"type":44,"tag":78,"props":4213,"children":4214},{"style":97},[4215],{"type":49,"value":1103},{"type":44,"tag":78,"props":4217,"children":4218},{"style":91},[4219],{"type":49,"value":449},{"type":44,"tag":78,"props":4221,"children":4222},{"style":97},[4223],{"type":49,"value":908},{"type":44,"tag":78,"props":4225,"children":4226},{"style":91},[4227],{"type":49,"value":105},{"type":44,"tag":78,"props":4229,"children":4230},{"style":216},[4231],{"type":49,"value":784},{"type":44,"tag":78,"props":4233,"children":4234},{"class":80,"line":266},[4235],{"type":44,"tag":78,"props":4236,"children":4237},{"style":91},[4238],{"type":49,"value":3065},{"type":44,"tag":78,"props":4240,"children":4241},{"class":80,"line":310},[4242,4247,4251,4255,4259,4263,4267,4271,4275,4279,4283,4287,4291,4295],{"type":44,"tag":78,"props":4243,"children":4244},{"style":97},[4245],{"type":49,"value":4246},"    metadata",{"type":44,"tag":78,"props":4248,"children":4249},{"style":91},[4250],{"type":49,"value":449},{"type":44,"tag":78,"props":4252,"children":4253},{"style":97},[4254],{"type":49,"value":3569},{"type":44,"tag":78,"props":4256,"children":4257},{"style":91},[4258],{"type":49,"value":449},{"type":44,"tag":78,"props":4260,"children":4261},{"style":275},[4262],{"type":49,"value":2954},{"type":44,"tag":78,"props":4264,"children":4265},{"style":216},[4266],{"type":49,"value":682},{"type":44,"tag":78,"props":4268,"children":4269},{"style":91},[4270],{"type":49,"value":1159},{"type":44,"tag":78,"props":4272,"children":4273},{"style":118},[4274],{"type":49,"value":3590},{"type":44,"tag":78,"props":4276,"children":4277},{"style":91},[4278],{"type":49,"value":1159},{"type":44,"tag":78,"props":4280,"children":4281},{"style":91},[4282],{"type":49,"value":153},{"type":44,"tag":78,"props":4284,"children":4285},{"style":97},[4286],{"type":49,"value":4122},{"type":44,"tag":78,"props":4288,"children":4289},{"style":91},[4290],{"type":49,"value":449},{"type":44,"tag":78,"props":4292,"children":4293},{"style":97},[4294],{"type":49,"value":3590},{"type":44,"tag":78,"props":4296,"children":4297},{"style":216},[4298],{"type":49,"value":784},{"type":44,"tag":78,"props":4300,"children":4301},{"class":80,"line":327},[4302,4307],{"type":44,"tag":78,"props":4303,"children":4304},{"style":275},[4305],{"type":49,"value":4306},"    commit",{"type":44,"tag":78,"props":4308,"children":4309},{"style":216},[4310],{"type":49,"value":816},{"type":44,"tag":78,"props":4312,"children":4313},{"class":80,"line":373},[4314,4319],{"type":44,"tag":78,"props":4315,"children":4316},{"style":91},[4317],{"type":49,"value":4318},"  }",{"type":44,"tag":78,"props":4320,"children":4321},{"style":216},[4322],{"type":49,"value":784},{"type":44,"tag":78,"props":4324,"children":4325},{"class":80,"line":416},[4326],{"type":44,"tag":78,"props":4327,"children":4328},{"emptyLinePlaceholder":185},[4329],{"type":49,"value":188},{"type":44,"tag":78,"props":4331,"children":4332},{"class":80,"line":429},[4333,4337,4341,4345,4349,4353,4358,4362,4366,4370,4374,4378],{"type":44,"tag":78,"props":4334,"children":4335},{"style":97},[4336],{"type":49,"value":4032},{"type":44,"tag":78,"props":4338,"children":4339},{"style":91},[4340],{"type":49,"value":449},{"type":44,"tag":78,"props":4342,"children":4343},{"style":275},[4344],{"type":49,"value":4041},{"type":44,"tag":78,"props":4346,"children":4347},{"style":216},[4348],{"type":49,"value":682},{"type":44,"tag":78,"props":4350,"children":4351},{"style":91},[4352],{"type":49,"value":1159},{"type":44,"tag":78,"props":4354,"children":4355},{"style":118},[4356],{"type":49,"value":4357},"ready",{"type":44,"tag":78,"props":4359,"children":4360},{"style":91},[4361],{"type":49,"value":1159},{"type":44,"tag":78,"props":4363,"children":4364},{"style":91},[4365],{"type":49,"value":153},{"type":44,"tag":78,"props":4367,"children":4368},{"style":91},[4369],{"type":49,"value":1473},{"type":44,"tag":78,"props":4371,"children":4372},{"style":195},[4373],{"type":49,"value":366},{"type":44,"tag":78,"props":4375,"children":4376},{"style":275},[4377],{"type":49,"value":526},{"type":44,"tag":78,"props":4379,"children":4380},{"style":216},[4381],{"type":49,"value":4382},"())\n",{"type":44,"tag":78,"props":4384,"children":4385},{"class":80,"line":462},[4386,4390,4394,4398,4402,4406,4411],{"type":44,"tag":78,"props":4387,"children":4388},{"style":85},[4389],{"type":49,"value":422},{"type":44,"tag":78,"props":4391,"children":4392},{"style":91},[4393],{"type":49,"value":1473},{"type":44,"tag":78,"props":4395,"children":4396},{"style":195},[4397],{"type":49,"value":366},{"type":44,"tag":78,"props":4399,"children":4400},{"style":97},[4401],{"type":49,"value":4002},{"type":44,"tag":78,"props":4403,"children":4404},{"style":91},[4405],{"type":49,"value":449},{"type":44,"tag":78,"props":4407,"children":4408},{"style":275},[4409],{"type":49,"value":4410},"close",{"type":44,"tag":78,"props":4412,"children":4413},{"style":216},[4414],{"type":49,"value":816},{"type":44,"tag":78,"props":4416,"children":4417},{"class":80,"line":479},[4418],{"type":44,"tag":78,"props":4419,"children":4420},{"style":91},[4421],{"type":49,"value":255},{"type":44,"tag":2206,"props":4423,"children":4425},{"id":4424},"expression-parsing-for-predicate-push-down",[4426],{"type":49,"value":4427},"Expression parsing for predicate push-down",{"type":44,"tag":66,"props":4429,"children":4431},{"className":68,"code":4430,"language":70,"meta":71,"style":71},"import {\n  parseWhereExpression,\n  parseOrderByExpression,\n  extractSimpleComparisons,\n} from '@tanstack\u002Fdb'\n\n\u002F\u002F In loadSubset or queryFn:\nconst comparisons = extractSimpleComparisons(options.where)\n\u002F\u002F Returns: [{ field: ['name'], operator: 'eq', value: 'John' }]\n\nconst orderBy = parseOrderByExpression(options.orderBy)\n\u002F\u002F Returns: [{ field: ['created_at'], direction: 'desc', nulls: 'last' }]\n",[4432],{"type":44,"tag":74,"props":4433,"children":4434},{"__ignoreMap":71},[4435,4446,4458,4470,4482,4505,4512,4520,4556,4564,4571,4605],{"type":44,"tag":78,"props":4436,"children":4437},{"class":80,"line":81},[4438,4442],{"type":44,"tag":78,"props":4439,"children":4440},{"style":85},[4441],{"type":49,"value":88},{"type":44,"tag":78,"props":4443,"children":4444},{"style":91},[4445],{"type":49,"value":209},{"type":44,"tag":78,"props":4447,"children":4448},{"class":80,"line":129},[4449,4454],{"type":44,"tag":78,"props":4450,"children":4451},{"style":97},[4452],{"type":49,"value":4453},"  parseWhereExpression",{"type":44,"tag":78,"props":4455,"children":4456},{"style":91},[4457],{"type":49,"value":459},{"type":44,"tag":78,"props":4459,"children":4460},{"class":80,"line":181},[4461,4466],{"type":44,"tag":78,"props":4462,"children":4463},{"style":97},[4464],{"type":49,"value":4465},"  parseOrderByExpression",{"type":44,"tag":78,"props":4467,"children":4468},{"style":91},[4469],{"type":49,"value":459},{"type":44,"tag":78,"props":4471,"children":4472},{"class":80,"line":191},[4473,4478],{"type":44,"tag":78,"props":4474,"children":4475},{"style":97},[4476],{"type":49,"value":4477},"  extractSimpleComparisons",{"type":44,"tag":78,"props":4479,"children":4480},{"style":91},[4481],{"type":49,"value":459},{"type":44,"tag":78,"props":4483,"children":4484},{"class":80,"line":212},[4485,4489,4493,4497,4501],{"type":44,"tag":78,"props":4486,"children":4487},{"style":91},[4488],{"type":49,"value":1875},{"type":44,"tag":78,"props":4490,"children":4491},{"style":85},[4492],{"type":49,"value":110},{"type":44,"tag":78,"props":4494,"children":4495},{"style":91},[4496],{"type":49,"value":115},{"type":44,"tag":78,"props":4498,"children":4499},{"style":118},[4500],{"type":49,"value":121},{"type":44,"tag":78,"props":4502,"children":4503},{"style":91},[4504],{"type":49,"value":126},{"type":44,"tag":78,"props":4506,"children":4507},{"class":80,"line":232},[4508],{"type":44,"tag":78,"props":4509,"children":4510},{"emptyLinePlaceholder":185},[4511],{"type":49,"value":188},{"type":44,"tag":78,"props":4513,"children":4514},{"class":80,"line":249},[4515],{"type":44,"tag":78,"props":4516,"children":4517},{"style":643},[4518],{"type":49,"value":4519},"\u002F\u002F In loadSubset or queryFn:\n",{"type":44,"tag":78,"props":4521,"children":4522},{"class":80,"line":258},[4523,4527,4532,4537,4542,4547,4551],{"type":44,"tag":78,"props":4524,"children":4525},{"style":195},[4526],{"type":49,"value":1098},{"type":44,"tag":78,"props":4528,"children":4529},{"style":97},[4530],{"type":49,"value":4531}," comparisons ",{"type":44,"tag":78,"props":4533,"children":4534},{"style":91},[4535],{"type":49,"value":4536},"=",{"type":44,"tag":78,"props":4538,"children":4539},{"style":275},[4540],{"type":49,"value":4541}," extractSimpleComparisons",{"type":44,"tag":78,"props":4543,"children":4544},{"style":97},[4545],{"type":49,"value":4546},"(options",{"type":44,"tag":78,"props":4548,"children":4549},{"style":91},[4550],{"type":49,"value":449},{"type":44,"tag":78,"props":4552,"children":4553},{"style":97},[4554],{"type":49,"value":4555},"where)\n",{"type":44,"tag":78,"props":4557,"children":4558},{"class":80,"line":266},[4559],{"type":44,"tag":78,"props":4560,"children":4561},{"style":643},[4562],{"type":49,"value":4563},"\u002F\u002F Returns: [{ field: ['name'], operator: 'eq', value: 'John' }]\n",{"type":44,"tag":78,"props":4565,"children":4566},{"class":80,"line":310},[4567],{"type":44,"tag":78,"props":4568,"children":4569},{"emptyLinePlaceholder":185},[4570],{"type":49,"value":188},{"type":44,"tag":78,"props":4572,"children":4573},{"class":80,"line":327},[4574,4578,4583,4587,4592,4596,4600],{"type":44,"tag":78,"props":4575,"children":4576},{"style":195},[4577],{"type":49,"value":1098},{"type":44,"tag":78,"props":4579,"children":4580},{"style":97},[4581],{"type":49,"value":4582}," orderBy ",{"type":44,"tag":78,"props":4584,"children":4585},{"style":91},[4586],{"type":49,"value":4536},{"type":44,"tag":78,"props":4588,"children":4589},{"style":275},[4590],{"type":49,"value":4591}," parseOrderByExpression",{"type":44,"tag":78,"props":4593,"children":4594},{"style":97},[4595],{"type":49,"value":4546},{"type":44,"tag":78,"props":4597,"children":4598},{"style":91},[4599],{"type":49,"value":449},{"type":44,"tag":78,"props":4601,"children":4602},{"style":97},[4603],{"type":49,"value":4604},"orderBy)\n",{"type":44,"tag":78,"props":4606,"children":4607},{"class":80,"line":373},[4608],{"type":44,"tag":78,"props":4609,"children":4610},{"style":643},[4611],{"type":49,"value":4612},"\u002F\u002F Returns: [{ field: ['created_at'], direction: 'desc', nulls: 'last' }]\n",{"type":44,"tag":59,"props":4614,"children":4616},{"id":4615},"common-mistakes",[4617],{"type":49,"value":4618},"Common Mistakes",{"type":44,"tag":2206,"props":4620,"children":4622},{"id":4621},"critical-not-calling-markready-in-sync-implementation",[4623],{"type":49,"value":4624},"CRITICAL Not calling markReady() in sync implementation",{"type":44,"tag":45,"props":4626,"children":4627},{},[4628],{"type":49,"value":4629},"Wrong:",{"type":44,"tag":66,"props":4631,"children":4633},{"className":68,"code":4632,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit }) => {\n  fetchData().then((items) => {\n    begin()\n    items.forEach((item) => write({ type: 'insert', value: item }))\n    commit()\n    \u002F\u002F forgot markReady()!\n  })\n}\n",[4634],{"type":44,"tag":74,"props":4635,"children":4636},{"__ignoreMap":71},[4637,4684,4729,4740,4834,4845,4853,4864],{"type":44,"tag":78,"props":4638,"children":4639},{"class":80,"line":81},[4640,4644,4648,4652,4656,4660,4664,4668,4672,4676,4680],{"type":44,"tag":78,"props":4641,"children":4642},{"style":201},[4643],{"type":49,"value":2636},{"type":44,"tag":78,"props":4645,"children":4646},{"style":91},[4647],{"type":49,"value":224},{"type":44,"tag":78,"props":4649,"children":4650},{"style":91},[4651],{"type":49,"value":494},{"type":44,"tag":78,"props":4653,"children":4654},{"style":296},[4655],{"type":49,"value":499},{"type":44,"tag":78,"props":4657,"children":4658},{"style":91},[4659],{"type":49,"value":153},{"type":44,"tag":78,"props":4661,"children":4662},{"style":296},[4663],{"type":49,"value":508},{"type":44,"tag":78,"props":4665,"children":4666},{"style":91},[4667],{"type":49,"value":153},{"type":44,"tag":78,"props":4669,"children":4670},{"style":296},[4671],{"type":49,"value":517},{"type":44,"tag":78,"props":4673,"children":4674},{"style":91},[4675],{"type":49,"value":549},{"type":44,"tag":78,"props":4677,"children":4678},{"style":195},[4679],{"type":49,"value":366},{"type":44,"tag":78,"props":4681,"children":4682},{"style":91},[4683],{"type":49,"value":209},{"type":44,"tag":78,"props":4685,"children":4686},{"class":80,"line":129},[4687,4692,4697,4701,4705,4709,4713,4717,4721,4725],{"type":44,"tag":78,"props":4688,"children":4689},{"style":275},[4690],{"type":49,"value":4691},"  fetchData",{"type":44,"tag":78,"props":4693,"children":4694},{"style":216},[4695],{"type":49,"value":4696},"()",{"type":44,"tag":78,"props":4698,"children":4699},{"style":91},[4700],{"type":49,"value":449},{"type":44,"tag":78,"props":4702,"children":4703},{"style":275},[4704],{"type":49,"value":997},{"type":44,"tag":78,"props":4706,"children":4707},{"style":216},[4708],{"type":49,"value":682},{"type":44,"tag":78,"props":4710,"children":4711},{"style":91},[4712],{"type":49,"value":682},{"type":44,"tag":78,"props":4714,"children":4715},{"style":296},[4716],{"type":49,"value":4131},{"type":44,"tag":78,"props":4718,"children":4719},{"style":91},[4720],{"type":49,"value":361},{"type":44,"tag":78,"props":4722,"children":4723},{"style":195},[4724],{"type":49,"value":366},{"type":44,"tag":78,"props":4726,"children":4727},{"style":91},[4728],{"type":49,"value":209},{"type":44,"tag":78,"props":4730,"children":4731},{"class":80,"line":181},[4732,4736],{"type":44,"tag":78,"props":4733,"children":4734},{"style":275},[4735],{"type":49,"value":4090},{"type":44,"tag":78,"props":4737,"children":4738},{"style":216},[4739],{"type":49,"value":816},{"type":44,"tag":78,"props":4741,"children":4742},{"class":80,"line":191},[4743,4748,4752,4757,4761,4765,4769,4773,4777,4781,4785,4789,4793,4797,4801,4805,4809,4813,4817,4821,4825,4829],{"type":44,"tag":78,"props":4744,"children":4745},{"style":97},[4746],{"type":49,"value":4747},"    items",{"type":44,"tag":78,"props":4749,"children":4750},{"style":91},[4751],{"type":49,"value":449},{"type":44,"tag":78,"props":4753,"children":4754},{"style":275},[4755],{"type":49,"value":4756},"forEach",{"type":44,"tag":78,"props":4758,"children":4759},{"style":216},[4760],{"type":49,"value":682},{"type":44,"tag":78,"props":4762,"children":4763},{"style":91},[4764],{"type":49,"value":682},{"type":44,"tag":78,"props":4766,"children":4767},{"style":296},[4768],{"type":49,"value":347},{"type":44,"tag":78,"props":4770,"children":4771},{"style":91},[4772],{"type":49,"value":361},{"type":44,"tag":78,"props":4774,"children":4775},{"style":195},[4776],{"type":49,"value":366},{"type":44,"tag":78,"props":4778,"children":4779},{"style":275},[4780],{"type":49,"value":508},{"type":44,"tag":78,"props":4782,"children":4783},{"style":216},[4784],{"type":49,"value":682},{"type":44,"tag":78,"props":4786,"children":4787},{"style":91},[4788],{"type":49,"value":834},{"type":44,"tag":78,"props":4790,"children":4791},{"style":216},[4792],{"type":49,"value":139},{"type":44,"tag":78,"props":4794,"children":4795},{"style":91},[4796],{"type":49,"value":224},{"type":44,"tag":78,"props":4798,"children":4799},{"style":91},[4800],{"type":49,"value":115},{"type":44,"tag":78,"props":4802,"children":4803},{"style":118},[4804],{"type":49,"value":1154},{"type":44,"tag":78,"props":4806,"children":4807},{"style":91},[4808],{"type":49,"value":1159},{"type":44,"tag":78,"props":4810,"children":4811},{"style":91},[4812],{"type":49,"value":153},{"type":44,"tag":78,"props":4814,"children":4815},{"style":216},[4816],{"type":49,"value":891},{"type":44,"tag":78,"props":4818,"children":4819},{"style":91},[4820],{"type":49,"value":224},{"type":44,"tag":78,"props":4822,"children":4823},{"style":97},[4824],{"type":49,"value":1103},{"type":44,"tag":78,"props":4826,"children":4827},{"style":91},[4828],{"type":49,"value":105},{"type":44,"tag":78,"props":4830,"children":4831},{"style":216},[4832],{"type":49,"value":4833},"))\n",{"type":44,"tag":78,"props":4835,"children":4836},{"class":80,"line":212},[4837,4841],{"type":44,"tag":78,"props":4838,"children":4839},{"style":275},[4840],{"type":49,"value":4306},{"type":44,"tag":78,"props":4842,"children":4843},{"style":216},[4844],{"type":49,"value":816},{"type":44,"tag":78,"props":4846,"children":4847},{"class":80,"line":232},[4848],{"type":44,"tag":78,"props":4849,"children":4850},{"style":643},[4851],{"type":49,"value":4852},"    \u002F\u002F forgot markReady()!\n",{"type":44,"tag":78,"props":4854,"children":4855},{"class":80,"line":249},[4856,4860],{"type":44,"tag":78,"props":4857,"children":4858},{"style":91},[4859],{"type":49,"value":4318},{"type":44,"tag":78,"props":4861,"children":4862},{"style":216},[4863],{"type":49,"value":784},{"type":44,"tag":78,"props":4865,"children":4866},{"class":80,"line":258},[4867],{"type":44,"tag":78,"props":4868,"children":4869},{"style":91},[4870],{"type":49,"value":255},{"type":44,"tag":45,"props":4872,"children":4873},{},[4874],{"type":49,"value":4875},"Correct:",{"type":44,"tag":66,"props":4877,"children":4879},{"className":68,"code":4878,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit, markReady }) => {\n  fetchData().then((items) => {\n    begin()\n    items.forEach((item) => write({ type: 'insert', value: item }))\n    commit()\n    markReady()\n  })\n}\n",[4880],{"type":44,"tag":74,"props":4881,"children":4882},{"__ignoreMap":71},[4883,4938,4981,4992,5083,5094,5105,5116],{"type":44,"tag":78,"props":4884,"children":4885},{"class":80,"line":81},[4886,4890,4894,4898,4902,4906,4910,4914,4918,4922,4926,4930,4934],{"type":44,"tag":78,"props":4887,"children":4888},{"style":201},[4889],{"type":49,"value":2636},{"type":44,"tag":78,"props":4891,"children":4892},{"style":91},[4893],{"type":49,"value":224},{"type":44,"tag":78,"props":4895,"children":4896},{"style":91},[4897],{"type":49,"value":494},{"type":44,"tag":78,"props":4899,"children":4900},{"style":296},[4901],{"type":49,"value":499},{"type":44,"tag":78,"props":4903,"children":4904},{"style":91},[4905],{"type":49,"value":153},{"type":44,"tag":78,"props":4907,"children":4908},{"style":296},[4909],{"type":49,"value":508},{"type":44,"tag":78,"props":4911,"children":4912},{"style":91},[4913],{"type":49,"value":153},{"type":44,"tag":78,"props":4915,"children":4916},{"style":296},[4917],{"type":49,"value":517},{"type":44,"tag":78,"props":4919,"children":4920},{"style":91},[4921],{"type":49,"value":153},{"type":44,"tag":78,"props":4923,"children":4924},{"style":296},[4925],{"type":49,"value":526},{"type":44,"tag":78,"props":4927,"children":4928},{"style":91},[4929],{"type":49,"value":549},{"type":44,"tag":78,"props":4931,"children":4932},{"style":195},[4933],{"type":49,"value":366},{"type":44,"tag":78,"props":4935,"children":4936},{"style":91},[4937],{"type":49,"value":209},{"type":44,"tag":78,"props":4939,"children":4940},{"class":80,"line":129},[4941,4945,4949,4953,4957,4961,4965,4969,4973,4977],{"type":44,"tag":78,"props":4942,"children":4943},{"style":275},[4944],{"type":49,"value":4691},{"type":44,"tag":78,"props":4946,"children":4947},{"style":216},[4948],{"type":49,"value":4696},{"type":44,"tag":78,"props":4950,"children":4951},{"style":91},[4952],{"type":49,"value":449},{"type":44,"tag":78,"props":4954,"children":4955},{"style":275},[4956],{"type":49,"value":997},{"type":44,"tag":78,"props":4958,"children":4959},{"style":216},[4960],{"type":49,"value":682},{"type":44,"tag":78,"props":4962,"children":4963},{"style":91},[4964],{"type":49,"value":682},{"type":44,"tag":78,"props":4966,"children":4967},{"style":296},[4968],{"type":49,"value":4131},{"type":44,"tag":78,"props":4970,"children":4971},{"style":91},[4972],{"type":49,"value":361},{"type":44,"tag":78,"props":4974,"children":4975},{"style":195},[4976],{"type":49,"value":366},{"type":44,"tag":78,"props":4978,"children":4979},{"style":91},[4980],{"type":49,"value":209},{"type":44,"tag":78,"props":4982,"children":4983},{"class":80,"line":181},[4984,4988],{"type":44,"tag":78,"props":4985,"children":4986},{"style":275},[4987],{"type":49,"value":4090},{"type":44,"tag":78,"props":4989,"children":4990},{"style":216},[4991],{"type":49,"value":816},{"type":44,"tag":78,"props":4993,"children":4994},{"class":80,"line":191},[4995,4999,5003,5007,5011,5015,5019,5023,5027,5031,5035,5039,5043,5047,5051,5055,5059,5063,5067,5071,5075,5079],{"type":44,"tag":78,"props":4996,"children":4997},{"style":97},[4998],{"type":49,"value":4747},{"type":44,"tag":78,"props":5000,"children":5001},{"style":91},[5002],{"type":49,"value":449},{"type":44,"tag":78,"props":5004,"children":5005},{"style":275},[5006],{"type":49,"value":4756},{"type":44,"tag":78,"props":5008,"children":5009},{"style":216},[5010],{"type":49,"value":682},{"type":44,"tag":78,"props":5012,"children":5013},{"style":91},[5014],{"type":49,"value":682},{"type":44,"tag":78,"props":5016,"children":5017},{"style":296},[5018],{"type":49,"value":347},{"type":44,"tag":78,"props":5020,"children":5021},{"style":91},[5022],{"type":49,"value":361},{"type":44,"tag":78,"props":5024,"children":5025},{"style":195},[5026],{"type":49,"value":366},{"type":44,"tag":78,"props":5028,"children":5029},{"style":275},[5030],{"type":49,"value":508},{"type":44,"tag":78,"props":5032,"children":5033},{"style":216},[5034],{"type":49,"value":682},{"type":44,"tag":78,"props":5036,"children":5037},{"style":91},[5038],{"type":49,"value":834},{"type":44,"tag":78,"props":5040,"children":5041},{"style":216},[5042],{"type":49,"value":139},{"type":44,"tag":78,"props":5044,"children":5045},{"style":91},[5046],{"type":49,"value":224},{"type":44,"tag":78,"props":5048,"children":5049},{"style":91},[5050],{"type":49,"value":115},{"type":44,"tag":78,"props":5052,"children":5053},{"style":118},[5054],{"type":49,"value":1154},{"type":44,"tag":78,"props":5056,"children":5057},{"style":91},[5058],{"type":49,"value":1159},{"type":44,"tag":78,"props":5060,"children":5061},{"style":91},[5062],{"type":49,"value":153},{"type":44,"tag":78,"props":5064,"children":5065},{"style":216},[5066],{"type":49,"value":891},{"type":44,"tag":78,"props":5068,"children":5069},{"style":91},[5070],{"type":49,"value":224},{"type":44,"tag":78,"props":5072,"children":5073},{"style":97},[5074],{"type":49,"value":1103},{"type":44,"tag":78,"props":5076,"children":5077},{"style":91},[5078],{"type":49,"value":105},{"type":44,"tag":78,"props":5080,"children":5081},{"style":216},[5082],{"type":49,"value":4833},{"type":44,"tag":78,"props":5084,"children":5085},{"class":80,"line":212},[5086,5090],{"type":44,"tag":78,"props":5087,"children":5088},{"style":275},[5089],{"type":49,"value":4306},{"type":44,"tag":78,"props":5091,"children":5092},{"style":216},[5093],{"type":49,"value":816},{"type":44,"tag":78,"props":5095,"children":5096},{"class":80,"line":232},[5097,5101],{"type":44,"tag":78,"props":5098,"children":5099},{"style":275},[5100],{"type":49,"value":2716},{"type":44,"tag":78,"props":5102,"children":5103},{"style":216},[5104],{"type":49,"value":816},{"type":44,"tag":78,"props":5106,"children":5107},{"class":80,"line":249},[5108,5112],{"type":44,"tag":78,"props":5109,"children":5110},{"style":91},[5111],{"type":49,"value":4318},{"type":44,"tag":78,"props":5113,"children":5114},{"style":216},[5115],{"type":49,"value":784},{"type":44,"tag":78,"props":5117,"children":5118},{"class":80,"line":258},[5119],{"type":44,"tag":78,"props":5120,"children":5121},{"style":91},[5122],{"type":49,"value":255},{"type":44,"tag":45,"props":5124,"children":5125},{},[5126,5132,5134,5140],{"type":44,"tag":74,"props":5127,"children":5129},{"className":5128},[],[5130],{"type":49,"value":5131},"markReady()",{"type":49,"value":5133}," transitions the collection to \"ready\" status. Without it, live queries never resolve and ",{"type":44,"tag":74,"props":5135,"children":5137},{"className":5136},[],[5138],{"type":49,"value":5139},"useLiveSuspenseQuery",{"type":49,"value":5141}," hangs forever in Suspense.",{"type":44,"tag":45,"props":5143,"children":5144},{},[5145],{"type":49,"value":5146},"Source: docs\u002Fguides\u002Fcollection-options-creator.md",{"type":44,"tag":2206,"props":5148,"children":5150},{"id":5149},"high-race-condition-subscribing-after-initial-fetch",[5151],{"type":49,"value":5152},"HIGH Race condition: subscribing after initial fetch",{"type":44,"tag":45,"props":5154,"children":5155},{},[5156],{"type":49,"value":4629},{"type":44,"tag":66,"props":5158,"children":5160},{"className":68,"code":5159,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit, markReady }) => {\n  fetchAll().then((data) => {\n    writeAll(data)\n    subscribe(onChange) \u002F\u002F changes during fetch are LOST\n    markReady()\n  })\n}\n",[5161],{"type":44,"tag":74,"props":5162,"children":5163},{"__ignoreMap":71},[5164,5219,5263,5283,5309,5320,5331],{"type":44,"tag":78,"props":5165,"children":5166},{"class":80,"line":81},[5167,5171,5175,5179,5183,5187,5191,5195,5199,5203,5207,5211,5215],{"type":44,"tag":78,"props":5168,"children":5169},{"style":201},[5170],{"type":49,"value":2636},{"type":44,"tag":78,"props":5172,"children":5173},{"style":91},[5174],{"type":49,"value":224},{"type":44,"tag":78,"props":5176,"children":5177},{"style":91},[5178],{"type":49,"value":494},{"type":44,"tag":78,"props":5180,"children":5181},{"style":296},[5182],{"type":49,"value":499},{"type":44,"tag":78,"props":5184,"children":5185},{"style":91},[5186],{"type":49,"value":153},{"type":44,"tag":78,"props":5188,"children":5189},{"style":296},[5190],{"type":49,"value":508},{"type":44,"tag":78,"props":5192,"children":5193},{"style":91},[5194],{"type":49,"value":153},{"type":44,"tag":78,"props":5196,"children":5197},{"style":296},[5198],{"type":49,"value":517},{"type":44,"tag":78,"props":5200,"children":5201},{"style":91},[5202],{"type":49,"value":153},{"type":44,"tag":78,"props":5204,"children":5205},{"style":296},[5206],{"type":49,"value":526},{"type":44,"tag":78,"props":5208,"children":5209},{"style":91},[5210],{"type":49,"value":549},{"type":44,"tag":78,"props":5212,"children":5213},{"style":195},[5214],{"type":49,"value":366},{"type":44,"tag":78,"props":5216,"children":5217},{"style":91},[5218],{"type":49,"value":209},{"type":44,"tag":78,"props":5220,"children":5221},{"class":80,"line":129},[5222,5227,5231,5235,5239,5243,5247,5251,5255,5259],{"type":44,"tag":78,"props":5223,"children":5224},{"style":275},[5225],{"type":49,"value":5226},"  fetchAll",{"type":44,"tag":78,"props":5228,"children":5229},{"style":216},[5230],{"type":49,"value":4696},{"type":44,"tag":78,"props":5232,"children":5233},{"style":91},[5234],{"type":49,"value":449},{"type":44,"tag":78,"props":5236,"children":5237},{"style":275},[5238],{"type":49,"value":997},{"type":44,"tag":78,"props":5240,"children":5241},{"style":216},[5242],{"type":49,"value":682},{"type":44,"tag":78,"props":5244,"children":5245},{"style":91},[5246],{"type":49,"value":682},{"type":44,"tag":78,"props":5248,"children":5249},{"style":296},[5250],{"type":49,"value":908},{"type":44,"tag":78,"props":5252,"children":5253},{"style":91},[5254],{"type":49,"value":361},{"type":44,"tag":78,"props":5256,"children":5257},{"style":195},[5258],{"type":49,"value":366},{"type":44,"tag":78,"props":5260,"children":5261},{"style":91},[5262],{"type":49,"value":209},{"type":44,"tag":78,"props":5264,"children":5265},{"class":80,"line":181},[5266,5271,5275,5279],{"type":44,"tag":78,"props":5267,"children":5268},{"style":275},[5269],{"type":49,"value":5270},"    writeAll",{"type":44,"tag":78,"props":5272,"children":5273},{"style":216},[5274],{"type":49,"value":682},{"type":44,"tag":78,"props":5276,"children":5277},{"style":97},[5278],{"type":49,"value":908},{"type":44,"tag":78,"props":5280,"children":5281},{"style":216},[5282],{"type":49,"value":784},{"type":44,"tag":78,"props":5284,"children":5285},{"class":80,"line":191},[5286,5291,5295,5300,5304],{"type":44,"tag":78,"props":5287,"children":5288},{"style":275},[5289],{"type":49,"value":5290},"    subscribe",{"type":44,"tag":78,"props":5292,"children":5293},{"style":216},[5294],{"type":49,"value":682},{"type":44,"tag":78,"props":5296,"children":5297},{"style":97},[5298],{"type":49,"value":5299},"onChange",{"type":44,"tag":78,"props":5301,"children":5302},{"style":216},[5303],{"type":49,"value":748},{"type":44,"tag":78,"props":5305,"children":5306},{"style":643},[5307],{"type":49,"value":5308},"\u002F\u002F changes during fetch are LOST\n",{"type":44,"tag":78,"props":5310,"children":5311},{"class":80,"line":212},[5312,5316],{"type":44,"tag":78,"props":5313,"children":5314},{"style":275},[5315],{"type":49,"value":2716},{"type":44,"tag":78,"props":5317,"children":5318},{"style":216},[5319],{"type":49,"value":816},{"type":44,"tag":78,"props":5321,"children":5322},{"class":80,"line":232},[5323,5327],{"type":44,"tag":78,"props":5324,"children":5325},{"style":91},[5326],{"type":49,"value":4318},{"type":44,"tag":78,"props":5328,"children":5329},{"style":216},[5330],{"type":49,"value":784},{"type":44,"tag":78,"props":5332,"children":5333},{"class":80,"line":249},[5334],{"type":44,"tag":78,"props":5335,"children":5336},{"style":91},[5337],{"type":49,"value":255},{"type":44,"tag":45,"props":5339,"children":5340},{},[5341],{"type":49,"value":4875},{"type":44,"tag":66,"props":5343,"children":5345},{"className":68,"code":5344,"language":70,"meta":71,"style":71},"sync: ({ begin, write, commit, markReady }) => {\n  const buffer = []\n  subscribe((event) => {\n    if (!ready) {\n      buffer.push(event)\n      return\n    }\n    begin()\n    write(event)\n    commit()\n  })\n  fetchAll().then((data) => {\n    writeAll(data)\n    ready = true\n    buffer.forEach((e) => {\n      begin()\n      write(e)\n      commit()\n    })\n    markReady()\n  })\n}\n",[5346],{"type":44,"tag":74,"props":5347,"children":5348},{"__ignoreMap":71},[5349,5404,5424,5456,5484,5512,5520,5527,5538,5558,5569,5580,5623,5642,5658,5699,5711,5730,5742,5754,5765,5776],{"type":44,"tag":78,"props":5350,"children":5351},{"class":80,"line":81},[5352,5356,5360,5364,5368,5372,5376,5380,5384,5388,5392,5396,5400],{"type":44,"tag":78,"props":5353,"children":5354},{"style":201},[5355],{"type":49,"value":2636},{"type":44,"tag":78,"props":5357,"children":5358},{"style":91},[5359],{"type":49,"value":224},{"type":44,"tag":78,"props":5361,"children":5362},{"style":91},[5363],{"type":49,"value":494},{"type":44,"tag":78,"props":5365,"children":5366},{"style":296},[5367],{"type":49,"value":499},{"type":44,"tag":78,"props":5369,"children":5370},{"style":91},[5371],{"type":49,"value":153},{"type":44,"tag":78,"props":5373,"children":5374},{"style":296},[5375],{"type":49,"value":508},{"type":44,"tag":78,"props":5377,"children":5378},{"style":91},[5379],{"type":49,"value":153},{"type":44,"tag":78,"props":5381,"children":5382},{"style":296},[5383],{"type":49,"value":517},{"type":44,"tag":78,"props":5385,"children":5386},{"style":91},[5387],{"type":49,"value":153},{"type":44,"tag":78,"props":5389,"children":5390},{"style":296},[5391],{"type":49,"value":526},{"type":44,"tag":78,"props":5393,"children":5394},{"style":91},[5395],{"type":49,"value":549},{"type":44,"tag":78,"props":5397,"children":5398},{"style":195},[5399],{"type":49,"value":366},{"type":44,"tag":78,"props":5401,"children":5402},{"style":91},[5403],{"type":49,"value":209},{"type":44,"tag":78,"props":5405,"children":5406},{"class":80,"line":129},[5407,5411,5416,5420],{"type":44,"tag":78,"props":5408,"children":5409},{"style":195},[5410],{"type":49,"value":3915},{"type":44,"tag":78,"props":5412,"children":5413},{"style":97},[5414],{"type":49,"value":5415}," buffer",{"type":44,"tag":78,"props":5417,"children":5418},{"style":91},[5419],{"type":49,"value":576},{"type":44,"tag":78,"props":5421,"children":5422},{"style":216},[5423],{"type":49,"value":628},{"type":44,"tag":78,"props":5425,"children":5426},{"class":80,"line":181},[5427,5432,5436,5440,5444,5448,5452],{"type":44,"tag":78,"props":5428,"children":5429},{"style":275},[5430],{"type":49,"value":5431},"  subscribe",{"type":44,"tag":78,"props":5433,"children":5434},{"style":216},[5435],{"type":49,"value":682},{"type":44,"tag":78,"props":5437,"children":5438},{"style":91},[5439],{"type":49,"value":682},{"type":44,"tag":78,"props":5441,"children":5442},{"style":296},[5443],{"type":49,"value":708},{"type":44,"tag":78,"props":5445,"children":5446},{"style":91},[5447],{"type":49,"value":361},{"type":44,"tag":78,"props":5449,"children":5450},{"style":195},[5451],{"type":49,"value":366},{"type":44,"tag":78,"props":5453,"children":5454},{"style":91},[5455],{"type":49,"value":209},{"type":44,"tag":78,"props":5457,"children":5458},{"class":80,"line":191},[5459,5464,5468,5472,5476,5480],{"type":44,"tag":78,"props":5460,"children":5461},{"style":85},[5462],{"type":49,"value":5463},"    if",{"type":44,"tag":78,"props":5465,"children":5466},{"style":216},[5467],{"type":49,"value":342},{"type":44,"tag":78,"props":5469,"children":5470},{"style":91},[5471],{"type":49,"value":738},{"type":44,"tag":78,"props":5473,"children":5474},{"style":97},[5475],{"type":49,"value":4357},{"type":44,"tag":78,"props":5477,"children":5478},{"style":216},[5479],{"type":49,"value":748},{"type":44,"tag":78,"props":5481,"children":5482},{"style":91},[5483],{"type":49,"value":753},{"type":44,"tag":78,"props":5485,"children":5486},{"class":80,"line":212},[5487,5492,5496,5500,5504,5508],{"type":44,"tag":78,"props":5488,"children":5489},{"style":97},[5490],{"type":49,"value":5491},"      buffer",{"type":44,"tag":78,"props":5493,"children":5494},{"style":91},[5495],{"type":49,"value":449},{"type":44,"tag":78,"props":5497,"children":5498},{"style":275},[5499],{"type":49,"value":771},{"type":44,"tag":78,"props":5501,"children":5502},{"style":216},[5503],{"type":49,"value":682},{"type":44,"tag":78,"props":5505,"children":5506},{"style":97},[5507],{"type":49,"value":708},{"type":44,"tag":78,"props":5509,"children":5510},{"style":216},[5511],{"type":49,"value":784},{"type":44,"tag":78,"props":5513,"children":5514},{"class":80,"line":232},[5515],{"type":44,"tag":78,"props":5516,"children":5517},{"style":85},[5518],{"type":49,"value":5519},"      return\n",{"type":44,"tag":78,"props":5521,"children":5522},{"class":80,"line":249},[5523],{"type":44,"tag":78,"props":5524,"children":5525},{"style":91},[5526],{"type":49,"value":3065},{"type":44,"tag":78,"props":5528,"children":5529},{"class":80,"line":258},[5530,5534],{"type":44,"tag":78,"props":5531,"children":5532},{"style":275},[5533],{"type":49,"value":4090},{"type":44,"tag":78,"props":5535,"children":5536},{"style":216},[5537],{"type":49,"value":816},{"type":44,"tag":78,"props":5539,"children":5540},{"class":80,"line":266},[5541,5546,5550,5554],{"type":44,"tag":78,"props":5542,"children":5543},{"style":275},[5544],{"type":49,"value":5545},"    write",{"type":44,"tag":78,"props":5547,"children":5548},{"style":216},[5549],{"type":49,"value":682},{"type":44,"tag":78,"props":5551,"children":5552},{"style":97},[5553],{"type":49,"value":708},{"type":44,"tag":78,"props":5555,"children":5556},{"style":216},[5557],{"type":49,"value":784},{"type":44,"tag":78,"props":5559,"children":5560},{"class":80,"line":310},[5561,5565],{"type":44,"tag":78,"props":5562,"children":5563},{"style":275},[5564],{"type":49,"value":4306},{"type":44,"tag":78,"props":5566,"children":5567},{"style":216},[5568],{"type":49,"value":816},{"type":44,"tag":78,"props":5570,"children":5571},{"class":80,"line":327},[5572,5576],{"type":44,"tag":78,"props":5573,"children":5574},{"style":91},[5575],{"type":49,"value":4318},{"type":44,"tag":78,"props":5577,"children":5578},{"style":216},[5579],{"type":49,"value":784},{"type":44,"tag":78,"props":5581,"children":5582},{"class":80,"line":373},[5583,5587,5591,5595,5599,5603,5607,5611,5615,5619],{"type":44,"tag":78,"props":5584,"children":5585},{"style":275},[5586],{"type":49,"value":5226},{"type":44,"tag":78,"props":5588,"children":5589},{"style":216},[5590],{"type":49,"value":4696},{"type":44,"tag":78,"props":5592,"children":5593},{"style":91},[5594],{"type":49,"value":449},{"type":44,"tag":78,"props":5596,"children":5597},{"style":275},[5598],{"type":49,"value":997},{"type":44,"tag":78,"props":5600,"children":5601},{"style":216},[5602],{"type":49,"value":682},{"type":44,"tag":78,"props":5604,"children":5605},{"style":91},[5606],{"type":49,"value":682},{"type":44,"tag":78,"props":5608,"children":5609},{"style":296},[5610],{"type":49,"value":908},{"type":44,"tag":78,"props":5612,"children":5613},{"style":91},[5614],{"type":49,"value":361},{"type":44,"tag":78,"props":5616,"children":5617},{"style":195},[5618],{"type":49,"value":366},{"type":44,"tag":78,"props":5620,"children":5621},{"style":91},[5622],{"type":49,"value":209},{"type":44,"tag":78,"props":5624,"children":5625},{"class":80,"line":416},[5626,5630,5634,5638],{"type":44,"tag":78,"props":5627,"children":5628},{"style":275},[5629],{"type":49,"value":5270},{"type":44,"tag":78,"props":5631,"children":5632},{"style":216},[5633],{"type":49,"value":682},{"type":44,"tag":78,"props":5635,"children":5636},{"style":97},[5637],{"type":49,"value":908},{"type":44,"tag":78,"props":5639,"children":5640},{"style":216},[5641],{"type":49,"value":784},{"type":44,"tag":78,"props":5643,"children":5644},{"class":80,"line":429},[5645,5650,5654],{"type":44,"tag":78,"props":5646,"children":5647},{"style":97},[5648],{"type":49,"value":5649},"    ready",{"type":44,"tag":78,"props":5651,"children":5652},{"style":91},[5653],{"type":49,"value":576},{"type":44,"tag":78,"props":5655,"children":5656},{"style":579},[5657],{"type":49,"value":1238},{"type":44,"tag":78,"props":5659,"children":5660},{"class":80,"line":462},[5661,5666,5670,5674,5678,5682,5687,5691,5695],{"type":44,"tag":78,"props":5662,"children":5663},{"style":97},[5664],{"type":49,"value":5665},"    buffer",{"type":44,"tag":78,"props":5667,"children":5668},{"style":91},[5669],{"type":49,"value":449},{"type":44,"tag":78,"props":5671,"children":5672},{"style":275},[5673],{"type":49,"value":4756},{"type":44,"tag":78,"props":5675,"children":5676},{"style":216},[5677],{"type":49,"value":682},{"type":44,"tag":78,"props":5679,"children":5680},{"style":91},[5681],{"type":49,"value":682},{"type":44,"tag":78,"props":5683,"children":5684},{"style":296},[5685],{"type":49,"value":5686},"e",{"type":44,"tag":78,"props":5688,"children":5689},{"style":91},[5690],{"type":49,"value":361},{"type":44,"tag":78,"props":5692,"children":5693},{"style":195},[5694],{"type":49,"value":366},{"type":44,"tag":78,"props":5696,"children":5697},{"style":91},[5698],{"type":49,"value":209},{"type":44,"tag":78,"props":5700,"children":5701},{"class":80,"line":479},[5702,5707],{"type":44,"tag":78,"props":5703,"children":5704},{"style":275},[5705],{"type":49,"value":5706},"      begin",{"type":44,"tag":78,"props":5708,"children":5709},{"style":216},[5710],{"type":49,"value":816},{"type":44,"tag":78,"props":5712,"children":5713},{"class":80,"line":560},[5714,5718,5722,5726],{"type":44,"tag":78,"props":5715,"children":5716},{"style":275},[5717],{"type":49,"value":4147},{"type":44,"tag":78,"props":5719,"children":5720},{"style":216},[5721],{"type":49,"value":682},{"type":44,"tag":78,"props":5723,"children":5724},{"style":97},[5725],{"type":49,"value":5686},{"type":44,"tag":78,"props":5727,"children":5728},{"style":216},[5729],{"type":49,"value":784},{"type":44,"tag":78,"props":5731,"children":5732},{"class":80,"line":585},[5733,5738],{"type":44,"tag":78,"props":5734,"children":5735},{"style":275},[5736],{"type":49,"value":5737},"      commit",{"type":44,"tag":78,"props":5739,"children":5740},{"style":216},[5741],{"type":49,"value":816},{"type":44,"tag":78,"props":5743,"children":5744},{"class":80,"line":631},[5745,5750],{"type":44,"tag":78,"props":5746,"children":5747},{"style":91},[5748],{"type":49,"value":5749},"    }",{"type":44,"tag":78,"props":5751,"children":5752},{"style":216},[5753],{"type":49,"value":784},{"type":44,"tag":78,"props":5755,"children":5756},{"class":80,"line":639},[5757,5761],{"type":44,"tag":78,"props":5758,"children":5759},{"style":275},[5760],{"type":49,"value":2716},{"type":44,"tag":78,"props":5762,"children":5763},{"style":216},[5764],{"type":49,"value":816},{"type":44,"tag":78,"props":5766,"children":5767},{"class":80,"line":649},[5768,5772],{"type":44,"tag":78,"props":5769,"children":5770},{"style":91},[5771],{"type":49,"value":4318},{"type":44,"tag":78,"props":5773,"children":5774},{"style":216},[5775],{"type":49,"value":784},{"type":44,"tag":78,"props":5777,"children":5778},{"class":80,"line":723},[5779],{"type":44,"tag":78,"props":5780,"children":5781},{"style":91},[5782],{"type":49,"value":255},{"type":44,"tag":45,"props":5784,"children":5785},{},[5786],{"type":49,"value":5787},"Subscribe to real-time events before fetching initial data. Buffer events during the fetch, then replay them after the initial sync completes.",{"type":44,"tag":45,"props":5789,"children":5790},{},[5791],{"type":49,"value":5146},{"type":44,"tag":2206,"props":5793,"children":5795},{"id":5794},"high-write-called-without-begin",[5796],{"type":49,"value":5797},"HIGH write() called without begin()",{"type":44,"tag":45,"props":5799,"children":5800},{},[5801],{"type":49,"value":4629},{"type":44,"tag":66,"props":5803,"children":5805},{"className":68,"code":5804,"language":70,"meta":71,"style":71},"onMessage((event) => {\n  write({ type: event.type, key: event.id, value: event.data })\n  commit()\n})\n",[5806],{"type":44,"tag":74,"props":5807,"children":5808},{"__ignoreMap":71},[5809,5841,5933,5945],{"type":44,"tag":78,"props":5810,"children":5811},{"class":80,"line":81},[5812,5817,5821,5825,5829,5833,5837],{"type":44,"tag":78,"props":5813,"children":5814},{"style":275},[5815],{"type":49,"value":5816},"onMessage",{"type":44,"tag":78,"props":5818,"children":5819},{"style":97},[5820],{"type":49,"value":682},{"type":44,"tag":78,"props":5822,"children":5823},{"style":91},[5824],{"type":49,"value":682},{"type":44,"tag":78,"props":5826,"children":5827},{"style":296},[5828],{"type":49,"value":708},{"type":44,"tag":78,"props":5830,"children":5831},{"style":91},[5832],{"type":49,"value":361},{"type":44,"tag":78,"props":5834,"children":5835},{"style":195},[5836],{"type":49,"value":366},{"type":44,"tag":78,"props":5838,"children":5839},{"style":91},[5840],{"type":49,"value":209},{"type":44,"tag":78,"props":5842,"children":5843},{"class":80,"line":129},[5844,5849,5853,5857,5861,5865,5869,5873,5877,5881,5885,5889,5893,5897,5901,5905,5909,5913,5917,5921,5925,5929],{"type":44,"tag":78,"props":5845,"children":5846},{"style":275},[5847],{"type":49,"value":5848},"  write",{"type":44,"tag":78,"props":5850,"children":5851},{"style":216},[5852],{"type":49,"value":682},{"type":44,"tag":78,"props":5854,"children":5855},{"style":91},[5856],{"type":49,"value":834},{"type":44,"tag":78,"props":5858,"children":5859},{"style":216},[5860],{"type":49,"value":139},{"type":44,"tag":78,"props":5862,"children":5863},{"style":91},[5864],{"type":49,"value":224},{"type":44,"tag":78,"props":5866,"children":5867},{"style":97},[5868],{"type":49,"value":847},{"type":44,"tag":78,"props":5870,"children":5871},{"style":91},[5872],{"type":49,"value":449},{"type":44,"tag":78,"props":5874,"children":5875},{"style":97},[5876],{"type":49,"value":856},{"type":44,"tag":78,"props":5878,"children":5879},{"style":91},[5880],{"type":49,"value":153},{"type":44,"tag":78,"props":5882,"children":5883},{"style":216},[5884],{"type":49,"value":865},{"type":44,"tag":78,"props":5886,"children":5887},{"style":91},[5888],{"type":49,"value":224},{"type":44,"tag":78,"props":5890,"children":5891},{"style":97},[5892],{"type":49,"value":847},{"type":44,"tag":78,"props":5894,"children":5895},{"style":91},[5896],{"type":49,"value":449},{"type":44,"tag":78,"props":5898,"children":5899},{"style":97},[5900],{"type":49,"value":882},{"type":44,"tag":78,"props":5902,"children":5903},{"style":91},[5904],{"type":49,"value":153},{"type":44,"tag":78,"props":5906,"children":5907},{"style":216},[5908],{"type":49,"value":891},{"type":44,"tag":78,"props":5910,"children":5911},{"style":91},[5912],{"type":49,"value":224},{"type":44,"tag":78,"props":5914,"children":5915},{"style":97},[5916],{"type":49,"value":847},{"type":44,"tag":78,"props":5918,"children":5919},{"style":91},[5920],{"type":49,"value":449},{"type":44,"tag":78,"props":5922,"children":5923},{"style":97},[5924],{"type":49,"value":908},{"type":44,"tag":78,"props":5926,"children":5927},{"style":91},[5928],{"type":49,"value":105},{"type":44,"tag":78,"props":5930,"children":5931},{"style":216},[5932],{"type":49,"value":784},{"type":44,"tag":78,"props":5934,"children":5935},{"class":80,"line":181},[5936,5941],{"type":44,"tag":78,"props":5937,"children":5938},{"style":275},[5939],{"type":49,"value":5940},"  commit",{"type":44,"tag":78,"props":5942,"children":5943},{"style":216},[5944],{"type":49,"value":816},{"type":44,"tag":78,"props":5946,"children":5947},{"class":80,"line":191},[5948,5952],{"type":44,"tag":78,"props":5949,"children":5950},{"style":91},[5951],{"type":49,"value":1875},{"type":44,"tag":78,"props":5953,"children":5954},{"style":97},[5955],{"type":49,"value":784},{"type":44,"tag":45,"props":5957,"children":5958},{},[5959],{"type":49,"value":4875},{"type":44,"tag":66,"props":5961,"children":5963},{"className":68,"code":5962,"language":70,"meta":71,"style":71},"onMessage((event) => {\n  begin()\n  write({ type: event.type, key: event.id, value: event.data })\n  commit()\n})\n",[5964],{"type":44,"tag":74,"props":5965,"children":5966},{"__ignoreMap":71},[5967,5998,6010,6101,6112],{"type":44,"tag":78,"props":5968,"children":5969},{"class":80,"line":81},[5970,5974,5978,5982,5986,5990,5994],{"type":44,"tag":78,"props":5971,"children":5972},{"style":275},[5973],{"type":49,"value":5816},{"type":44,"tag":78,"props":5975,"children":5976},{"style":97},[5977],{"type":49,"value":682},{"type":44,"tag":78,"props":5979,"children":5980},{"style":91},[5981],{"type":49,"value":682},{"type":44,"tag":78,"props":5983,"children":5984},{"style":296},[5985],{"type":49,"value":708},{"type":44,"tag":78,"props":5987,"children":5988},{"style":91},[5989],{"type":49,"value":361},{"type":44,"tag":78,"props":5991,"children":5992},{"style":195},[5993],{"type":49,"value":366},{"type":44,"tag":78,"props":5995,"children":5996},{"style":91},[5997],{"type":49,"value":209},{"type":44,"tag":78,"props":5999,"children":6000},{"class":80,"line":129},[6001,6006],{"type":44,"tag":78,"props":6002,"children":6003},{"style":275},[6004],{"type":49,"value":6005},"  begin",{"type":44,"tag":78,"props":6007,"children":6008},{"style":216},[6009],{"type":49,"value":816},{"type":44,"tag":78,"props":6011,"children":6012},{"class":80,"line":181},[6013,6017,6021,6025,6029,6033,6037,6041,6045,6049,6053,6057,6061,6065,6069,6073,6077,6081,6085,6089,6093,6097],{"type":44,"tag":78,"props":6014,"children":6015},{"style":275},[6016],{"type":49,"value":5848},{"type":44,"tag":78,"props":6018,"children":6019},{"style":216},[6020],{"type":49,"value":682},{"type":44,"tag":78,"props":6022,"children":6023},{"style":91},[6024],{"type":49,"value":834},{"type":44,"tag":78,"props":6026,"children":6027},{"style":216},[6028],{"type":49,"value":139},{"type":44,"tag":78,"props":6030,"children":6031},{"style":91},[6032],{"type":49,"value":224},{"type":44,"tag":78,"props":6034,"children":6035},{"style":97},[6036],{"type":49,"value":847},{"type":44,"tag":78,"props":6038,"children":6039},{"style":91},[6040],{"type":49,"value":449},{"type":44,"tag":78,"props":6042,"children":6043},{"style":97},[6044],{"type":49,"value":856},{"type":44,"tag":78,"props":6046,"children":6047},{"style":91},[6048],{"type":49,"value":153},{"type":44,"tag":78,"props":6050,"children":6051},{"style":216},[6052],{"type":49,"value":865},{"type":44,"tag":78,"props":6054,"children":6055},{"style":91},[6056],{"type":49,"value":224},{"type":44,"tag":78,"props":6058,"children":6059},{"style":97},[6060],{"type":49,"value":847},{"type":44,"tag":78,"props":6062,"children":6063},{"style":91},[6064],{"type":49,"value":449},{"type":44,"tag":78,"props":6066,"children":6067},{"style":97},[6068],{"type":49,"value":882},{"type":44,"tag":78,"props":6070,"children":6071},{"style":91},[6072],{"type":49,"value":153},{"type":44,"tag":78,"props":6074,"children":6075},{"style":216},[6076],{"type":49,"value":891},{"type":44,"tag":78,"props":6078,"children":6079},{"style":91},[6080],{"type":49,"value":224},{"type":44,"tag":78,"props":6082,"children":6083},{"style":97},[6084],{"type":49,"value":847},{"type":44,"tag":78,"props":6086,"children":6087},{"style":91},[6088],{"type":49,"value":449},{"type":44,"tag":78,"props":6090,"children":6091},{"style":97},[6092],{"type":49,"value":908},{"type":44,"tag":78,"props":6094,"children":6095},{"style":91},[6096],{"type":49,"value":105},{"type":44,"tag":78,"props":6098,"children":6099},{"style":216},[6100],{"type":49,"value":784},{"type":44,"tag":78,"props":6102,"children":6103},{"class":80,"line":191},[6104,6108],{"type":44,"tag":78,"props":6105,"children":6106},{"style":275},[6107],{"type":49,"value":5940},{"type":44,"tag":78,"props":6109,"children":6110},{"style":216},[6111],{"type":49,"value":816},{"type":44,"tag":78,"props":6113,"children":6114},{"class":80,"line":212},[6115,6119],{"type":44,"tag":78,"props":6116,"children":6117},{"style":91},[6118],{"type":49,"value":1875},{"type":44,"tag":78,"props":6120,"children":6121},{"style":97},[6122],{"type":49,"value":784},{"type":44,"tag":45,"props":6124,"children":6125},{},[6126,6128,6133,6135,6140,6141,6146,6148,6154,6156,6162,6164,6170],{"type":49,"value":6127},"Sync data must be written within a transaction (",{"type":44,"tag":74,"props":6129,"children":6131},{"className":6130},[],[6132],{"type":49,"value":3279},{"type":49,"value":6134}," → ",{"type":44,"tag":74,"props":6136,"children":6138},{"className":6137},[],[6139],{"type":49,"value":2234},{"type":49,"value":6134},{"type":44,"tag":74,"props":6142,"children":6144},{"className":6143},[],[6145],{"type":49,"value":3293},{"type":49,"value":6147},"). Calling ",{"type":44,"tag":74,"props":6149,"children":6151},{"className":6150},[],[6152],{"type":49,"value":6153},"write()",{"type":49,"value":6155}," without ",{"type":44,"tag":74,"props":6157,"children":6159},{"className":6158},[],[6160],{"type":49,"value":6161},"begin()",{"type":49,"value":6163}," throws ",{"type":44,"tag":74,"props":6165,"children":6167},{"className":6166},[],[6168],{"type":49,"value":6169},"NoPendingSyncTransactionWriteError",{"type":49,"value":449},{"type":44,"tag":45,"props":6172,"children":6173},{},[6174],{"type":49,"value":6175},"Source: packages\u002Fdb\u002Fsrc\u002Fcollection\u002Fsync.ts:110",{"type":44,"tag":59,"props":6177,"children":6179},{"id":6178},"tension-simplicity-vs-correctness-in-sync",[6180],{"type":49,"value":6181},"Tension: Simplicity vs. Correctness in Sync",{"type":44,"tag":45,"props":6183,"children":6184},{},[6185],{"type":49,"value":6186},"Getting-started simplicity (localOnly, eager mode) conflicts with production correctness (on-demand sync, race condition prevention, proper markReady handling). Agents optimizing for quick setup tend to skip buffering, markReady, and cleanup functions.",{"type":44,"tag":45,"props":6188,"children":6189},{},[6190],{"type":49,"value":6191},"See also: db-core\u002Fcollection-setup\u002FSKILL.md — for built-in adapter patterns to model after.",{"type":44,"tag":6193,"props":6194,"children":6195},"style",{},[6196],{"type":49,"value":6197},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":6199,"total":6341},[6200,6216,6228,6240,6255,6267,6277,6287,6300,6310,6321,6331],{"slug":6201,"name":6201,"fn":6202,"description":6203,"org":6204,"tags":6205,"stars":6213,"repoUrl":6214,"updatedAt":6215},"aggregation","perform data aggregation in TanStack Table","Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6206,6209,6212],{"name":6207,"slug":6208,"type":16},"Data Analysis","data-analysis",{"name":6210,"slug":6211,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":6217,"name":6217,"fn":6218,"description":6219,"org":6220,"tags":6221,"stars":6213,"repoUrl":6214,"updatedAt":6227},"api-not-found","diagnose TanStack Table API errors","Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6222,6225,6226],{"name":6223,"slug":6224,"type":16},"Debugging","debugging",{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":6229,"name":6229,"fn":6230,"description":6231,"org":6232,"tags":6233,"stars":6213,"repoUrl":6214,"updatedAt":6239},"cell-selection","select rectangular cell ranges in tables","Select rectangular cell ranges with cellSelectionFeature: two-corner range state keyed by row and column id, mousedown\u002Fmouseenter handlers, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load when ranges widen unexpectedly after sorting or column reordering, when a drag re-renders the whole table, or when building copy-to-clipboard from a selection.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6234,6235,6236],{"name":6207,"slug":6208,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":6241,"name":6241,"fn":6242,"description":6243,"org":6244,"tags":6245,"stars":6213,"repoUrl":6214,"updatedAt":6254},"client-vs-server","manage TanStack Table data pipelines","Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6246,6249,6250,6253],{"name":6247,"slug":6248,"type":16},"Data Pipeline","data-pipeline",{"name":6210,"slug":6211,"type":16},{"name":6251,"slug":6252,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":6256,"name":6256,"fn":6257,"description":6258,"org":6259,"tags":6260,"stars":6213,"repoUrl":6214,"updatedAt":6266},"column-faceting","build faceted filter UIs","Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6261,6264,6265],{"name":6262,"slug":6263,"type":16},"Data Visualization","data-visualization",{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":6268,"name":6268,"fn":6269,"description":6270,"org":6271,"tags":6272,"stars":6213,"repoUrl":6214,"updatedAt":6276},"column-filtering","implement column filtering in TanStack Table","Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client\u002Fserver ownership.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6273,6274,6275],{"name":6207,"slug":6208,"type":16},{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":6278,"name":6278,"fn":6279,"description":6280,"org":6281,"tags":6282,"stars":6213,"repoUrl":6214,"updatedAt":6286},"column-ordering","manage TanStack Table column ordering","Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6283,6284,6285],{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:26:03.37801",{"slug":6288,"name":6288,"fn":6289,"description":6290,"org":6291,"tags":6292,"stars":6213,"repoUrl":6214,"updatedAt":6299},"column-pinning","configure column pinning in TanStack Table","Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6293,6296,6297,6298],{"name":6294,"slug":6295,"type":16},"CSS","css",{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:25:55.377366",{"slug":6301,"name":6301,"fn":6302,"description":6303,"org":6304,"tags":6305,"stars":6213,"repoUrl":6214,"updatedAt":6309},"column-resizing","implement column resizing in TanStack Table","Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6306,6307,6308],{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:25:51.400011",{"slug":6311,"name":6311,"fn":6312,"description":6313,"org":6314,"tags":6315,"stars":6213,"repoUrl":6214,"updatedAt":6320},"column-sizing","configure column sizing in TanStack Table","Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing\u002Fpinning layout mismatch.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6316,6317,6318,6319],{"name":6294,"slug":6295,"type":16},{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:25:48.703799",{"slug":6322,"name":6322,"fn":6323,"description":6324,"org":6325,"tags":6326,"stars":6213,"repoUrl":6214,"updatedAt":6330},"column-visibility","manage column visibility in TanStack Table","Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6327,6328,6329],{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:25:47.367943",{"slug":6332,"name":6332,"fn":6333,"description":6334,"org":6335,"tags":6336,"stars":6213,"repoUrl":6214,"updatedAt":6340},"core","build data grids with TanStack Table","Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, row numbering with getDisplayIndex, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6337,6338,6339],{"name":6207,"slug":6208,"type":16},{"name":6210,"slug":6211,"type":16},{"name":6237,"slug":6238,"type":16},"2026-07-30T05:25:52.366295",125,{"items":6343,"total":416},[6344,6358,6370,6381,6387,6400,6411],{"slug":6345,"name":6345,"fn":6346,"description":6347,"org":6348,"tags":6349,"stars":21,"repoUrl":22,"updatedAt":6357},"angular-db","integrate TanStack DB with Angular","Angular bindings for TanStack DB. injectLiveQuery inject function with Angular signals (Signal\u003CT>) for all return values. Reactive params pattern ({ params: () => T, query: ({ params, q }) => QueryBuilder }) for dynamic queries. Must be called in injection context. Angular 17+ control flow (@if, @for) and signal inputs supported. Import from @tanstack\u002Fangular-db (re-exports all of @tanstack\u002Fdb).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6350,6353,6354],{"name":6351,"slug":6352,"type":16},"Angular","angular",{"name":14,"slug":15,"type":16},{"name":6355,"slug":6356,"type":16},"TypeScript","typescript","2026-07-16T06:01:16.345046",{"slug":6359,"name":6359,"fn":6360,"description":6361,"org":6362,"tags":6363,"stars":21,"repoUrl":22,"updatedAt":6369},"db-core","manage database collections with TanStack DB","TanStack DB core concepts: createCollection with queryCollectionOptions, electricCollectionOptions, powerSyncCollectionOptions, rxdbCollectionOptions, trailbaseCollectionOptions, localOnlyCollectionOptions. Live queries via query builder (from, where, join, select, groupBy, orderBy, limit). Optimistic mutations with draft proxy (collection.insert, collection.update, collection.delete). createOptimisticAction, createTransaction, createPacedMutations. Entry point for all TanStack DB skills.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6364,6367,6368],{"name":6365,"slug":6366,"type":16},"Data Modeling","data-modeling",{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-17T06:06:40.214285",{"slug":6371,"name":6372,"fn":6373,"description":6374,"org":6375,"tags":6376,"stars":21,"repoUrl":22,"updatedAt":6380},"db-corecollection-setup","db-core\u002Fcollection-setup","set up typed collections in TanStack DB","Creating typed collections with createCollection. Adapter selection: queryCollectionOptions (REST\u002FTanStack Query), electricCollectionOptions (ElectricSQL real-time sync), powerSyncCollectionOptions (PowerSync SQLite), rxdbCollectionOptions (RxDB), trailbaseCollectionOptions (TrailBase), localOnlyCollectionOptions, localStorageCollectionOptions. CollectionConfig options: getKey, schema, sync, gcTime, autoIndex (default off), defaultIndexType, syncMode (eager\u002Fon-demand, plus progressive for Electric). StandardSchema validation with Zod\u002FValibot\u002FArkType. Collection lifecycle (idle\u002Floading\u002Fready\u002Ferror). Adapter-specific sync patterns including Electric txid tracking, Query direct writes, and PowerSync query-driven sync with onLoad\u002FonLoadSubset hooks.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6377,6378,6379],{"name":6365,"slug":6366,"type":16},{"name":14,"slug":15,"type":16},{"name":10,"slug":9,"type":16},"2026-07-26T05:48:58.321777",{"slug":4,"name":5,"fn":6,"description":7,"org":6382,"tags":6383,"stars":21,"repoUrl":22,"updatedAt":23},{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6384,6385,6386],{"name":14,"slug":15,"type":16},{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},{"slug":6388,"name":6389,"fn":6390,"description":6391,"org":6392,"tags":6393,"stars":21,"repoUrl":22,"updatedAt":6399},"db-corelive-queries","db-core\u002Flive-queries","build live queries with TanStack DB","Query builder fluent API: from, where, join, leftJoin, rightJoin, innerJoin, fullJoin, select, fn.select, groupBy, having, orderBy, limit, offset, distinct, findOne. Operators: eq, gt, gte, lt, lte, like, ilike, inArray, isNull, isUndefined, and, or, not. Aggregates: count, sum, avg, min, max. String functions: upper, lower, length, concat. Utility: coalesce, caseWhen. Math: add. $selected namespace. createLiveQueryCollection. Derived collections. Predicate push-down. Incremental view maintenance via differential dataflow (d2ts). Virtual properties ($synced, $origin, $key, $collectionId). Includes subqueries for hierarchical data. toArray and concat(toArray(...)) scalar includes. queryOnce for one-shot queries. createEffect for reactive side effects (onEnter, onUpdate, onExit, onBatch).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6394,6395,6398],{"name":14,"slug":15,"type":16},{"name":6396,"slug":6397,"type":16},"SQL","sql",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:08.757365",{"slug":6401,"name":6402,"fn":6403,"description":6404,"org":6405,"tags":6406,"stars":21,"repoUrl":22,"updatedAt":6410},"db-coremutations-optimistic","db-core\u002Fmutations-optimistic","manage optimistic mutations in TanStack DB","collection.insert, collection.update (Immer-style draft proxy), collection.delete. createOptimisticAction (onMutate + mutationFn). createPacedMutations with debounceStrategy, throttleStrategy, queueStrategy. createTransaction, getActiveTransaction, ambient transaction context. Transaction lifecycle (pending\u002Fpersisting\u002Fcompleted\u002Ffailed). Mutation merging. onInsert\u002FonUpdate\u002FonDelete handlers. PendingMutation type. Transaction.isPersisted.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6407,6408,6409],{"name":14,"slug":15,"type":16},{"name":6210,"slug":6211,"type":16},{"name":10,"slug":9,"type":16},"2026-07-26T05:48:57.301803",{"slug":6412,"name":6413,"fn":6414,"description":6415,"org":6416,"tags":6417,"stars":21,"repoUrl":22,"updatedAt":6426},"db-corepersistence","db-core\u002Fpersistence","implement SQLite-backed persistence for TanStack DB","SQLite-backed persistence for TanStack DB collections. persistedCollectionOptions wraps any adapter (Electric, Query, PowerSync, or local-only) with durable local storage. Platform adapters: browser (WA-SQLite OPFS), React Native (op-sqlite), Expo (expo-sqlite), Electron (IPC), Node (better-sqlite3), Capacitor, Tauri, Cloudflare Durable Objects. Multi-tab\u002Fmulti-process coordination via BrowserCollectionCoordinator \u002F ElectronCollectionCoordinator \u002F SingleProcessCoordinator. schemaVersion for migration resets. Local-only mode for offline-first without a server.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[6418,6419,6422,6425],{"name":14,"slug":15,"type":16},{"name":6420,"slug":6421,"type":16},"Persistence","persistence",{"name":6423,"slug":6424,"type":16},"SQLite","sqlite",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.182084"]