{"version":3,"file":"installApiCache.cjs","names":["QUERY_CACHE_CONTEXT_KEY"],"sources":["../../../src/api/installApiCache/installApiCache.ts"],"sourcesContent":["import { QUERY_CACHE_CONTEXT_KEY } from '@pastweb/tools/api/createQueryCache/constants';\nimport type { Installer } from '../../GlobalContext';\nimport type { ApiCacheOptions } from './types';\n\n/**\n * Creates a GlobalContext installer for API query cache support.\n *\n * @param options - API integration options.\n * @param options.queryCache - Query cache shared by API hooks and SSR hydration.\n *\n * @returns Installer that provides the query cache under the tools query cache context key.\n *\n * @example\n * import { createQueryCache } from '@pastweb/tools';\n * import { GlobalContext, installApiCache } from '@pastweb/react';\n *\n * const queryCache = createQueryCache();\n * const apiCache = installApiCache({ queryCache });\n *\n * <GlobalContext use={apiCache}>\n *   <App />\n * </GlobalContext>\n */\nexport function installApiCache(options: ApiCacheOptions): Installer {\n  const { queryCache } = options;\n\n  return () => ({\n    [QUERY_CACHE_CONTEXT_KEY]: queryCache,\n  });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,gBAAgB,SAAqC;CACnE,MAAM,EAAE,eAAe;CAEvB,cAAc,GACXA,8CAAAA,0BAA0B,WAC7B;AACF"}