The one wrapper over TanStack Query for the apps in this repo: `useDataQuery` reads a value and `useCursorQuery` loads a keyset-paged list one page at a time, so no component imports `@tanstack/react-query` itself.

pnpm add @behivetech/hooks.use-data-query

You are viewing Use Data Query v0.1.1, snapshotted 2026-11-10. The latest is v0.1.2. Go to the latest →

Changelog up to v0.1.1

v0.1.1

Patch Changes

  • b12f0c9: Dependency updates: Radix UI (checkbox 1.4, dialog 1.3, dropdown-menu 2.2, select 2.4, slot 1.5, switch 1.4, toast 1.3, tooltip 1.4), react-hook-form 7.91, TipTap 3.33 and TanStack Query 5.107. No API changes. TipTap 3.33 brings prosemirror-view 1.42.6 or later, which fixes a paste XSS (GHSA-c8x8-7fp4-3x9w). In the rich-text editor, Tab at the start of a paragraph right after a list now moves that paragraph into the list (TipTap's list keymap, from 3.30) instead of moving focus out of the editor.

v0.1.0

Minor Changes

  • b2e862d: useDataQuery takes a refetchInterval (a delay, false, or a function that gets the last data and picks the next delay) so a read can check again on a schedule while it is enabled. Additive: reads without it behave as before.
  • 35c3f28: New hook package: useDataQuery and useCursorQuery, the one wrapper over TanStack Query for the apps. useCursorQuery loads a keyset-paged list one page at a time: the first page comes from the caller, only later pages are cached in memory, a failed page keeps the rows and waits for retry, and a row seen twice is kept once. DataQueryProvider mounts the cache so an app never imports the query library, and useInvalidateData drops cached lists by key prefix after a change. @tanstack/react-query is a regular dependency of the package, not a peer, so an app installs one package. The later pages of a list stay cached for 30 seconds after it unmounts.