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

@tanstack/lit-query

v0.2.2

Published

Lit adapter for TanStack Query Core

Readme

@tanstack/lit-query

Lit adapter for @tanstack/query-core using Lit reactive controllers.

This package is currently experimental and v0.1. Pin exact versions if you use it in production while the API is early.

Install

npm install @tanstack/lit-query @tanstack/query-core lit

For local development in this repository:

pnpm install
pnpm --dir packages/lit-query run build

Quick Start

import { LitElement, html } from 'lit'
import {
  QueryClient,
  QueryClientProvider,
  createQueryController,
} from '@tanstack/lit-query'

const client = new QueryClient({
  defaultOptions: { queries: { retry: false } },
})

class AppProvider extends QueryClientProvider {
  constructor() {
    super()
    this.client = client
  }
}
customElements.define('app-provider', AppProvider)

class UsersView extends LitElement {
  private readonly users = createQueryController(this, {
    queryKey: ['users'],
    queryFn: async () => {
      const response = await fetch('/api/users')
      return response.json() as Promise<Array<{ id: string; name: string }>>
    },
  })

  render() {
    const query = this.users()
    if (query.isPending) return html`Loading...`
    if (query.isError) return html`Error`
    return html`<ul>
      ${query.data?.map((u) => html`<li>${u.name}</li>`)}
    </ul>`
  }
}
customElements.define('users-view', UsersView)

API Surface

  • QueryClientProvider, useQueryClient, resolveQueryClient
  • createQueryController
  • createMutationController
  • createInfiniteQueryController
  • createQueriesController
  • useIsFetching, useIsMutating, useMutationState
  • queryOptions, infiniteQueryOptions, mutationOptions

Runnable Examples

This repo includes runnable Lit examples under the top-level examples/lit directory so they can be surfaced in the docs:

  • examples/lit/basic: Vite Lit app covering query and mutation primitives.
  • examples/lit/pagination: pagination, prefetching, optimistic updates, and error recovery.
  • examples/lit/ssr: Lit SSR render, dehydrate, and hydrate flow.

Run an example from the repo root:

pnpm --dir examples/lit/basic run dev
pnpm --dir examples/lit/pagination run dev
pnpm --dir examples/lit/ssr run dev

Open:

  • http://127.0.0.1:4173/ (basic example)
  • http://127.0.0.1:4183/ (pagination example app)
  • http://127.0.0.1:4174/ (SSR example app)

Use a different port (optional):

DEMO_PORT=4180 pnpm --dir examples/lit/basic run dev
PAGINATION_DEMO_PORT=4181 PAGINATION_API_PORT=4182 pnpm --dir examples/lit/pagination run dev
SSR_PORT=4180 pnpm --dir examples/lit/ssr run dev
SSR_HOST=0.0.0.0 pnpm --dir examples/lit/ssr run dev

Integration Smoke

For the framework build smoke used in CI:

pnpm --dir integrations/lit-vite run build

Quality Gates

From the repository root:

pnpm --dir packages/lit-query run test:types
pnpm --dir packages/lit-query run test:lib
pnpm --dir packages/lit-query run build
pnpm --dir packages/lit-query run test:build

License

MIT