{"_id":"@accessible-react-mentions/tanstack","name":"@accessible-react-mentions/tanstack","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@accessible-react-mentions/tanstack","version":"0.0.1","description":"TanStack Query data-source adapter for @accessible-react-mentions/core. Bridges a consumer's existing QueryClient into the mention data contract.","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"dependencies":{"@accessible-react-mentions/core":"0.1.0"},"peerDependencies":{"@tanstack/react-query":"^5.0.0","react":"^18.0.0 || ^19.0.0"},"devDependencies":{"@tanstack/react-query":"^5.62.0","@types/react":"^19.0.1","react":"^19.0.0","tsdown":"^0.21.10","typescript":"^6.0.3","vitest":"^4.1.5"},"publishConfig":{"access":"public"},"scripts":{"build":"tsdown","dev":"tsdown --watch","test":"vitest run --passWithNoTests","typecheck":"tsc --noEmit"},"_id":"@accessible-react-mentions/tanstack@0.0.1","_integrity":"sha512-Mc5qpSovynhNXGWj1FOZ1FvcffQw3osJX7F6G3uvXAJWTv5zpE+jX5xltOT28sJ4fyBP2vQXMaG4ij4It2KIRA==","_resolved":"/private/var/folders/39/9xywyt255_d0vfpsvctvjmz80000gn/T/fec059ecf80657f240eb80177c95bab2/accessible-react-mentions-tanstack-0.0.1.tgz","_from":"file:accessible-react-mentions-tanstack-0.0.1.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-Mc5qpSovynhNXGWj1FOZ1FvcffQw3osJX7F6G3uvXAJWTv5zpE+jX5xltOT28sJ4fyBP2vQXMaG4ij4It2KIRA==","shasum":"069019071ccb4df2ce72df4fd1dd3768de75b929","tarball":"https://registry.npmjs.org/@accessible-react-mentions/tanstack/-/tanstack-0.0.1.tgz","fileCount":12,"unpackedSize":5106,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGA1SRii1Zu6M2gLTPjqZeAbzYiaDjlsUaMEvnp/GvXPAiEA1+XfIgflclKBuNofeohxfyDW/Y1txNh562/qyjOLdKY="}]},"_npmUser":{"name":"karan715","email":"karanthakur715@gmail.com"},"directories":{},"maintainers":[{"name":"karan715","email":"karanthakur715@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tanstack_0.0.1_1777372350422_0.4831551797281426"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-28T10:32:30.315Z","0.0.1":"2026-04-28T10:32:30.554Z","modified":"2026-04-28T10:32:30.811Z"},"maintainers":[{"name":"karan715","email":"karanthakur715@gmail.com"}],"description":"TanStack Query data-source adapter for @accessible-react-mentions/core. Bridges a consumer's existing QueryClient into the mention data contract.","license":"MIT","readme":"# @accessible-react-mentions/tanstack\n\n[TanStack Query](https://tanstack.com/query) data-source adapter for [`@accessible-react-mentions/core`](../core). Bridges a consumer's existing `QueryClient` into the mention data contract — so a chat app with thousands of users gets cache sharing, request dedup, and `useInfiniteQuery`-backed pagination across the whole app, not just the mention picker.\n\n> **Status: pre-alpha (v0.0.0).** This is a workspace placeholder so the package name is reserved on npm. The functional `useTanStackMentionSource` hook ships with v1.0.\n\n## Why a separate package\n\nThe headless core has zero dependencies and ships its own request lifecycle (debounce + AbortSignal + dedup + LRU + pagination). That's enough for most consumers.\n\nIf your app already uses TanStack Query, this adapter lets the mention listbox share your existing `QueryClient` so:\n\n- Cache lookups for the same `@`-list are deduplicated app-wide\n- Hovering a user card pre-populates the mention picker\n- TanStack devtools, retry policies, and offline behavior carry over\n\n## Planned API\n\n```tsx\nimport { useTanStackMentionSource } from '@accessible-react-mentions/tanstack';\n\nconst usersSource = useTanStackMentionSource({\n  queryKey: (query) => ['users', { q: query }],\n  queryFn: ({ pageParam, signal, query }) =>\n    fetch(`/api/users?q=${query}&cursor=${pageParam ?? ''}`, { signal }).then((r) => r.json()),\n  getNextPageParam: (last) => last.nextCursor,\n});\n\n<Mention.Trigger char=\"@\" source={usersSource} />\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-a1f441f273c457e38fef203f33083b4a"}