@tanstack/db
Version:
A reactive client store for building super fast apps on sync
1 lines • 1.06 kB
Source Map (JSON)
{"version":3,"file":"pooled-source.cjs","sources":["../../../src/query/pooled-source.ts"],"sourcesContent":["import type { CollectionImpl } from '../collection/index.js'\n\n// A pooled view's source Collection. A view registers here when it is\n// created, so the live-query observer finds the source without bundling\n// pooling into apps that never import `pooledLiveQueries`.\nconst pooledSources = new WeakMap<\n object,\n CollectionImpl<any, any, any, any, any>\n>()\n\nexport function registerPooledSource(\n view: object,\n source: CollectionImpl<any, any, any, any, any>,\n): void {\n pooledSources.set(view, source)\n}\n\nexport function getPooledLiveQuerySource(\n value: unknown,\n): CollectionImpl<any, any, any, any, any> | undefined {\n return typeof value === `object` && value !== null\n ? pooledSources.get(value)\n : undefined\n}\n"],"names":[],"mappings":";;AAKA,MAAM,oCAAoB,QAAA;AAKnB,SAAS,qBACd,MACA,QACM;AACN,gBAAc,IAAI,MAAM,MAAM;AAChC;AAEO,SAAS,yBACd,OACqD;AACrD,SAAO,OAAO,UAAU,YAAY,UAAU,OAC1C,cAAc,IAAI,KAAK,IACvB;AACN;;;"}