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

@abtx/react-live-state-editor

v0.1.1

Published

A dev-only floating panel to inspect and live-edit React Query cache data

Readme

react-live-state-editor — catch missing UI states before you ship

A dev-only floating panel that lets you inspect, edit, simulate, and track UI states for React Query and Apollo Client — without touching your code.

Stop guessing how your UI behaves. Live State Editor shows you what you forgot.


Why?

When building UI (especially with AI), it's easy to miss:

  • Empty states ([])
  • Error states (500, null)
  • Loading states
  • Edge cases in real data

Live State Editor makes all of these visible and testable in seconds.


Features

🔍 Inspect & Edit

  • View all active queries in real time
  • Edit cache data live — UI rerenders instantly
  • Reset to the original server response

📌 Pin & Persist States

  • Pin a query to lock it — backend refetches won't overwrite it
  • Pinned state persists across page reloads via localStorage
  • Edit a pinned query and it auto-saves

⚠️ State Coverage

  • Four states tracked per query: success · empty · error · loading
  • Tick them off manually as you verify each one
  • Coverage persists across reloads
  • Queries with missing states show a warning badge in the list
  • Green dot next to a query = all states verified

⚡ Simulate States

  • Click Success / Empty / Error / Loading to preview each state instantly
  • Copy a prompt to paste into your IDE — instructs the AI to fix missing states using your existing components

🖱️ Panel UX

  • Drag the panel anywhere on screen
  • Resize from any edge or corner
  • Minimize to a dot to stay out of the way

Install

npm install @abtx/react-live-state-editor

Setup

Option 1 — Interactive installer (recommended)

Run this in your project root:

npx @abtx/react-live-state-editor init

It auto-detects React Query and/or Apollo Client, lets you confirm, and prints a ready-to-paste snippet.


Option 2 — Manual setup

React Query

import { LiveStateEditor } from '@abtx/react-live-state-editor'

// Wrap inside your QueryClientProvider:
<QueryClientProvider client={queryClient}>
  <LiveStateEditor>
    <App />
  </LiveStateEditor>
</QueryClientProvider>

Apollo Client

import { LiveStateEditor, ApolloAdapter } from '@abtx/react-live-state-editor'
import { useApolloClient } from '@apollo/client'

function Providers({ children }) {
  const apolloClient = useApolloClient()
  return (
    <LiveStateEditor adapters={[new ApolloAdapter(apolloClient)]}>
      {children}
    </LiveStateEditor>
  )
}

Both React Query + Apollo

import { LiveStateEditor, ReactQueryAdapter, ApolloAdapter } from '@abtx/react-live-state-editor'
import { useQueryClient } from '@tanstack/react-query'
import { useApolloClient } from '@apollo/client'

function Providers({ children }) {
  const queryClient  = useQueryClient()
  const apolloClient = useApolloClient()
  return (
    <LiveStateEditor adapters={[
      new ReactQueryAdapter(queryClient),
      new ApolloAdapter(apolloClient),
    ]}>
      {children}
    </LiveStateEditor>
  )
}

The panel appears automatically in development. In production, <LiveStateEditor> renders nothing but its children — zero overhead.


Peer dependencies

| Library | Required | |---|---| | react >=17 | ✅ | | react-dom >=17 | ✅ | | @tanstack/react-query >=4 | if using React Query | | @apollo/client >=3 | if using Apollo |


API

<LiveStateEditor>

| Prop | Type | Default | Description | |---|---|---|---| | adapters | CacheAdapter[] | auto-detects React Query | Explicit adapters. Omit to use React Query from context. |

ReactQueryAdapter

new ReactQueryAdapter(queryClient: QueryClient)

ApolloAdapter

new ApolloAdapter(apolloClient: ApolloClient<any>)

Supports: patch, reset, simulate loading (via refetch). Does not support: simulate error (no stable public Apollo API).

Custom adapters

Implement the CacheAdapter interface to connect any data-fetching layer:

import type { CacheAdapter, AdapterQuerySnapshot } from '@abtx/react-live-state-editor'

class MyAdapter implements CacheAdapter {
  readonly id = 'my-layer'
  snapshot() { /* return AdapterQuerySnapshot[] */ }
  subscribe(cb) { /* subscribe to cache changes, return unsubscribe fn */ }
  patch(state, data) { /* write new data */ }
  reset(state, originalData) { /* restore original */ }
}

useLiveStateEditor()

Access the editor context directly:

const { store, patchQuery, resetQuery, saveQuery, unsaveQuery } = useLiveStateEditor()

Production safety

  • Panel only renders when NODE_ENV === 'development'
  • <LiveStateEditor> in production is a transparent pass-through wrapper
  • No production bundle impact — tree-shaken automatically

License

MIT