@comwit/state
v2.2.1
Published
React state management for vibe coding. Less tokens. Built for Claude Code.
Maintainers
Readme
@comwit/state
React / Next.js state management for vibe coding.
Battle-tested across 1,000+ projects on comwit.io — a Claude Code-powered vibe coding platform from Korea. Sponsored by burrr.ai.
Renamed from
comwit. As of v2.0.0 this library is published as@comwit/state. The API is unchanged — only the package name and import specifier changed. See the migration notes.
Install
npm i @comwit/stateSetup
https://library.comwit.io/llms.txtPass the URL to Claude Code. It handles the rest.
Durable on-demand queries (2.2 beta)
const todos = local.collection<Todo>({ key: 'todos', version: 1 })
const todo = model({
list: local.query<Todo[], TodoFilter>({
source: todos,
initialData: [],
queryFn: api.todo.list,
}),
detail: local<Todo | null, { id: string }>({
source: todos,
initialData: null,
}),
})local() restores an exact IndexedDB view without making an API request, which fits server-owned
SEO details. local.query() and local.infinite() add background server revalidation while keeping
the existing .load(), .query(), .refetch(), .set(), and optimistic mutation interfaces.
