Skip to content
Source
Sign inSign up
TanStack/store

docs: add atom guide #317

Openlooooown2006(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/317/headopened

Summary

Adds a dedicated Atoms guide to cover the missing atom documentation requested in #316.

The new page explains:

  • what atoms are in TanStack Store;
  • how writable atoms, readonly derived atoms, subscriptions, comparison, and async atoms work;
  • how atoms compare with Store;
  • where framework adapters fit in;
  • links to the relevant API reference pages.

Also adds the page to the Getting Started navigation.

Tests

  • pnpm exec prettier --check docs/atoms.md docs/config.json
  • node --experimental-strip-types scripts/verify-links.ts
  • git diff --check

Note: pnpm run test:docs currently runs node scripts/verify-links.ts, which fails on this local Node 22 setup because the script is a .ts file without a loader. I ran the same link checker with Node's --experimental-strip-types flag instead.

Closes #316.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guide to atoms as reactive primitives, including writable and derived atoms, async atoms with status semantics, custom equality mechanisms, and framework-specific integration examples for React, Preact, and Angular.
    • Enhanced documentation navigation structure with new "Quick Start" and "Atoms" sections in Getting Started.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Review Change Stack No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: 4cf1fce3-3905-4732-8bd3-1d2a0318dde1

      📥 Commits

      Reviewing files that changed from the base of the PR and between 83e2978f627ec53616249b2bda1037749b18b6ab and 6388dc178b99942b1e0b3c487111175899326096.

      📒 Files selected for processing (2)
      • docs/atoms.md
      • docs/config.json

      📝 Walkthrough

      Walkthrough

      This PR adds comprehensive documentation for TanStack Store's atoms API as low-level reactive primitives, covering writable atoms, derived atoms, async atoms, and comparisons with stores. Navigation configuration is updated to include the new atoms documentation page in the Getting Started section.

      Changes

      Atoms Documentation

      Layer / File(s)Summary
      Atom Concept Introduction
      docs/atoms.md
      Introduces atoms as reactive primitives, describing their purpose and how they differ from higher-level Store APIs.
      Writable Atoms
      docs/atoms.md
      Documents createAtom API with examples of get, set (supporting value or updater function), and subscribe/unsubscribe patterns.
      Derived and Async Atoms
      docs/atoms.md
      Covers readonly derived atoms with reactive dependency tracking, custom equality via compare, and createAsyncAtom with pending/done/error state shapes.
      Atoms vs Stores, Framework Adapters, and API Reference
      docs/atoms.md
      Comparison table contrasting atoms and stores, framework adapter usage (React/Preact useAtom/useSelector, Angular injectAtom), and links to related API references.
      Navigation Configuration
      docs/config.json
      Updates Getting Started section navigation to include Quick Start and Atoms entries.

      Estimated code review effort

      🎯 1 (Trivial) | ⏱️ ~8 minutes

      Poem

      A fluffy doc now hops and springs, Teaching atoms—small reactive things. From writable to async dreams they soar, Framework adapters open every door. 🐰✨ atoms shine like carrots more!

      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title accurately and concisely describes the main change: adding a new atom guide to the documentation.
      Description check✅ PassedThe PR description comprehensively covers the changes made, testing performed, and references the linked issue, though it deviates slightly from the template structure.
      Linked Issues check✅ PassedThe PR fully addresses issue #316 by adding comprehensive atom documentation including explanations, comparisons with Store, and API references.
      Out of Scope Changes check✅ PassedAll changes are directly related to documenting atoms and updating navigation configuration as required by issue #316; no out-of-scope modifications detected.
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
      ✏️ Tip: You can configure your own custom pre-merge checks in the settings.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Tip

      💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

      Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

      • Generate code and open pull requests
      • Plan features and break down work
      • Investigate incidents and troubleshoot customer tickets together
      • Automate recurring tasks and respond to alerts with triggers
      • Summarize progress and report instantly

      Built for teams:

      • Shared memory across your entire org—no repeating context
      • Per-thread sandboxes to safely plan and execute work
      • Governance built-in—scoped access, auditability, and budget controls

      One agent for your entire SDLC. Right inside Slack.

      👉 Get started


      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.

Sign in to join this conversation.