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

@cqrs-toolkit/client-solid

v0.1.0

Published

SolidJS reactive primitives for @cqrs-toolkit/client

Downloads

108

Readme

@cqrs-toolkit/client-solid

SolidJS reactive primitives for @cqrs-toolkit/client. Provides createListQuery and createItemQuery -- thin wrappers that bridge the client's query manager into SolidJS stores with fine-grained reactivity.

Install

npm install @cqrs-toolkit/client-solid

Peer dependency: solid-js ^1.6.0.

Quick Start

import { createListQuery } from '@cqrs-toolkit/client-solid'

function TodosPage() {
  const client = useClient() // your app's client context

  const query = createListQuery<Todo>(client.queryManager, 'todos')

  return (
    <Show when={!query.loading} fallback={<p>Loading...</p>}>
      <p>{query.total} todos</p>
      <For each={query.items}>{(todo) => <TodoItem todo={todo} />}</For>
    </Show>
  )
}

createListQuery

Reactive list query that subscribes to collection changes.

function createListQuery<T extends Identifiable>(
  queryManager: IQueryManager,
  collection: string,
  options?: ListQueryOptions,
): ListQueryState<T>

Fetches the collection immediately, subscribes via watchCollection, and refetches on each update. Uses createStore + reconcile with key: 'id' for stable <For> identity. Automatically holds the cache key and releases it on cleanup.

ListQueryState<T>

| Property | Type | Description | | ----------------- | -------------- | ------------------------------------------------------------ | | items | readonly T[] | The current list of items | | loading | boolean | true until the first fetch completes | | total | number | Total count (may differ from items.length with pagination) | | hasLocalChanges | boolean | Whether any items have unconfirmed optimistic updates | | error | unknown | Set if a fetch fails |

ListQueryOptions

| Option | Type | Description | | -------- | -------- | ------------------------------ | | scope | string | Custom scope for the cache key | | limit | number | Max items to return | | offset | number | Pagination offset |

createItemQuery

Reactive single-item query that re-subscribes when the ID changes.

function createItemQuery<T extends Identifiable>(
  queryManager: IQueryManager,
  collection: string,
  id: () => string,
  options?: ItemQueryOptions,
): ItemQueryState<T>

The id parameter is an accessor, so it re-subscribes automatically when the ID changes (e.g., route param changes). Fetches immediately, subscribes via watchCollection filtered by the target ID, and refetches on matching updates.

ItemQueryState<T>

| Property | Type | Description | | ----------------- | ---------------- | --------------------------------------------------- | | data | T \| undefined | The item, or undefined if not found | | loading | boolean | true until the first fetch completes | | hasLocalChanges | boolean | Whether the item has unconfirmed optimistic updates | | error | unknown | Set if a fetch fails |

ItemQueryOptions

| Option | Type | Description | | ------- | -------- | ------------------------------ | | scope | string | Custom scope for the cache key |

Example

import { createItemQuery } from '@cqrs-toolkit/client-solid'

function TodoDetail() {
  const params = useParams()
  const client = useClient()

  const query = createItemQuery<Todo>(client.queryManager, 'todos', () => params.id)

  return (
    <Show when={!query.loading} fallback={<p>Loading...</p>}>
      <Show when={query.data} fallback={<p>Not found</p>}>
        {(todo) => <h1>{todo().content}</h1>}
      </Show>
    </Show>
  )
}

Identifiable

Both primitives require items to satisfy the Identifiable constraint:

interface Identifiable {
  readonly id: string
}

This is used by reconcile for stable identity tracking in <For> loops.