Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Tanstack Store

  • 75 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

tanstack-store is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • tanstack-store
  • AI & Agent Building
  • AI-coding skill

Tanstack Store by the numbers

  • 75 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #5,460 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill tanstack-store

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs75
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

TanStack Store

Overview

TanStack Store is a lightweight, framework-agnostic reactive state management library with type-safe updates, derived computations, batched mutations, and effect management. It powers the core of TanStack libraries internally and can be used as a standalone state solution. Framework adapters are available for React, Vue, Solid, Angular, and Svelte.

Core primitives:

  • Store — reactive container with setState, subscriptions, and lifecycle hooks
  • Derived — lazily computed values that track Store/Derived dependencies
  • Effect — side-effect runner triggered by dependency changes
  • batch — groups multiple updates so subscribers fire once

When to use: Shared reactive state across components, derived/computed values from multiple stores, batched state updates, framework-agnostic state logic reusable across React/Vue/Solid/Angular/Svelte, lightweight alternative to Redux/Zustand/MobX.

When NOT to use: Server state and caching (TanStack Query), complex normalized state with middleware (Redux Toolkit), form state management (TanStack Form), simple component-local state (useState/useSignal).

Key characteristics:

  • Tiny bundle size with zero dependencies
  • Immutable update model (always return new references from setState)
  • Lazy evaluation for Derived values (recompute only when accessed after change)
  • Explicit mount/unmount lifecycle for Derived and Effect (no automatic cleanup)

Installation

PackageUse Case
@tanstack/storeFramework-agnostic core
@tanstack/react-storeReact adapter (re-exports core)
@tanstack/vue-storeVue adapter
@tanstack/solid-storeSolid adapter
@tanstack/angular-storeAngular adapter
@tanstack/svelte-storeSvelte adapter

Framework packages re-export the core Store, Derived, Effect, and batch — install only the framework package, not both.

Quick Reference

PatternAPIKey Points
Create storenew Store(initialState, options?)Generic over TState and TUpdater
Read statestore.stateSynchronous property access
Previous statestore.prevStateValue before last setState call
Update statestore.setState((prev) => newState)Accepts updater function or direct value
Subscribestore.subscribe(listener)Returns unsubscribe function
Derived valuenew Derived({ deps, fn })Lazily recomputes when dependencies change
Mount derivedderived.mount()Required to activate dependency tracking
Derived from derivedNest Derived in another depsForms a computation graph
Batch updatesbatch(() => { ... })Subscribers notified once after all updates
Side effectsnew Effect({ deps, fn, eager? })Runs fn when dependencies change
Mount effecteffect.mount()Required to start listening
React bindinguseStore(store, selector?)Re-renders only when selected value changes
Shallow compareuseStore(store, selector, shallow)Prevents re-renders for structurally equal objects
Lifecycle: subscribeonSubscribe optionFires on first subscriber, cleanup on last
Lifecycle: updateonUpdate optionFires after every state change
Custom updaterupdateFn optionReplace default setState behavior
Previous depsfn: ({ prevDepVals })Compare current vs previous dependency values
Dep vals accessfn: ({ currDepVals })Array ordered by deps declaration order

Common Mistakes

MistakeCorrect Pattern
Reading derived.state without mountingCall derived.mount() before accessing state
Forgetting to unmount derived/effectStore the cleanup function and call it on teardown
Multiple setState calls without batchingWrap related updates in batch() to avoid intermediate recomputation
Selecting objects in useStore without shallowPass shallow as third argument to prevent unnecessary re-renders
Mutating state object directlyAlways return a new object from setState updater
Subscribing inside render without cleanupUse useStore hook in React instead of manual subscribe
Creating stores inside React componentsInstantiate stores outside components or in a ref/useState
Not including all deps in DerivedList every Store/Derived dependency in the deps array
Mounting Derived deps after the parentMount leaf dependencies before parent Derived values
Using @tanstack/store with React directlyInstall @tanstack/react-store which re-exports core

Delegation

  • Server state and caching: Delegate to the tanstack-query skill if available. Otherwise, recommend: npx skills add oakoss/agent-skills --skill tanstack-query
  • React component patterns: Delegate to framework-specific skills for component architecture
  • Form state management: Delegate to the tanstack-form skill if available. Otherwise, recommend: npx skills add oakoss/agent-skills --skill tanstack-form
  • Query pattern discovery: Use Explore agent to find examples in the codebase
  • Code review: Delegate to code-reviewer agent for store architecture review

References

  • Core concepts: Store, setState, subscriptions, and lifecycle hooks
  • Derived state: computed values, dependency tracking, and batching
  • React integration: useStore hook, selectors, and performance

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.