npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@octanejs/tanstack-query

v0.1.37

Published

TanStack Query bindings for the octane renderer — reuses @tanstack/query-core and swaps the React binding for octane's hooks.

Readme

@octanejs/tanstack-query

TanStack Query for the octane UI framework.

TanStack Query separates a framework-agnostic core (@tanstack/query-core — the QueryClient, observers, and caches) from a React binding (@tanstack/react-query) built on useSyncExternalStore + context. This package reuses the core verbatim and reimplements only the binding on octane's hooks. The public surface matches @tanstack/react-query, so most query code works by changing the import.

// before
import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query';
// after
import { QueryClient, QueryClientProvider, useQuery } from '@octanejs/tanstack-query';

const client = new QueryClient();

function Todos() @{
  const q = useQuery({ queryKey: ['todos'], queryFn: fetchTodos });
  @if (q.isPending) { <span>loading…</span> }
  @else if (q.isError) { <span>{(q.error as Error).message as string}</span> }
  @else { <ul>{q.data as unknown}</ul> }
}

function App() @{
  <QueryClientProvider client={client}>
    <Todos />
  </QueryClientProvider>
}

What's bound

  • Queries: useQuery, useInfiniteQuery, useSuspenseQuery, useSuspenseInfiniteQuery, useQueries, usePrefetchQuery, usePrefetchInfiniteQuery
  • Mutations: useMutation, useMutationState
  • Status: useIsFetching, useIsMutating
  • Components / context: QueryClientProvider, useQueryClient, QueryClientContext, HydrationBoundary, IsRestoringProvider, useIsRestoring, QueryErrorResetBoundary, useQueryErrorResetBoundary
  • everything from @tanstack/query-core (QueryClient, QueryCache, observers, dehydrate/hydrate, …), re-exported verbatim.

The whole @tanstack/react-query surface is bound. The separate companion packages (@tanstack/react-query-persist-client, @tanstack/react-query-devtools) are not included.

How it works

octane keys hooks by a compiler-injected per-call-site Symbol, appended as the last argument of every use* call. The binding's hooks compose several base hooks (useState for the observer, useSyncExternalStore to subscribe, useEffect for option changes), so each forwards a distinct sub-slot derived from the one it receives. QueryClientProvider is a component (it renders a context Provider + a mount effect), so it's authored in .tsrx.

Suspense & error boundaries

A query with suspense: true suspends, and a query/mutation with throwOnError throws its error. Catch them with either octane form — the <Suspense> / <ErrorBoundary> components or the @try { } @pending { } @catch { } directive:

import { Suspense, ErrorBoundary } from 'octane';

<ErrorBoundary fallback={(err) => <Oops error={err} />}>
  <Suspense fallback={<Spinner />}>
    <Profile />   {/* useQuery({ queryKey, queryFn, suspense: true }) */}
  </Suspense>
</ErrorBoundary>

Persistence & error resets

IsRestoringProvider / useIsRestoring gate fetching while a persisted client is restored, and QueryErrorResetBoundary / useQueryErrorResetBoundary coordinate error-boundary retries with @catch / <ErrorBoundary> — call the boundary's reset() alongside useQueryErrorResetBoundary().reset() so a throwOnError query refetches instead of immediately re-throwing.

Status

Current scope, known divergences, and verification status are tracked in the generated bindings status table, sourced from this package's status.json.