TanStackStore v0
Auto
Framework
Version
Menu
  • Home
  • Frameworks
  • Contributors
  • GitHub
  • Discord
Getting Started
  • Overview
    core
  • Installation
    core
  • Quick Start
    core
  • Quick Start
    react
API Reference
  • Core API Reference
    core
  • React Hooks
    react
Store API Reference
  • Store
    core
  • ReadonlyStore
    core
  • Atom
    core
  • AtomOptions
    core
  • BaseAtom
    core
  • InternalBaseAtom
    core
  • InternalReadonlyAtom
    core
  • InteropSubscribable
    core
  • Readable
    core
  • ReadonlyAtom
    core
  • StoreActionsApi
    core
  • Subscribable
    core
  • Subscription
    core
  • AnyAtom
    core
  • Observer
    core
  • Selection
    core
  • StoreAction
    core
  • StoreActionMap
    core
  • StoreActionsFactory
    core
  • batch
    core
  • createAsyncAtom
    core
  • createAtom
    core
  • createStore
    core
  • flush
    core
  • shallow
    core
  • toObserver
    core
  • createStoreContext
    react
  • useCreateAtom
    react
  • useCreateStore
    react
  • useSelector
    react
  • useSetValue
    react
  • useAtom
    react
  • useStoreActions
    react
  • _useStore (experimental)
    react
  • useStore (deprecated)
    react
  • UseSelectorOptions
    react
Examples
  • Simple
    react
  • Atoms
    react
  • Stores
    react
  • Store Actions
    react
  • Store Context
    react
TanStackStore v0
Auto
Framework
Version
Menu
  • Home
  • Frameworks
  • Contributors
  • GitHub
  • Discord
Getting Started
  • Overview
    core
  • Installation
    core
  • Quick Start
    core
  • Quick Start
    react
API Reference
  • Core API Reference
    core
  • React Hooks
    react
Store API Reference
  • Store
    core
  • ReadonlyStore
    core
  • Atom
    core
  • AtomOptions
    core
  • BaseAtom
    core
  • InternalBaseAtom
    core
  • InternalReadonlyAtom
    core
  • InteropSubscribable
    core
  • Readable
    core
  • ReadonlyAtom
    core
  • StoreActionsApi
    core
  • Subscribable
    core
  • Subscription
    core
  • AnyAtom
    core
  • Observer
    core
  • Selection
    core
  • StoreAction
    core
  • StoreActionMap
    core
  • StoreActionsFactory
    core
  • batch
    core
  • createAsyncAtom
    core
  • createAtom
    core
  • createStore
    core
  • flush
    core
  • shallow
    core
  • toObserver
    core
  • createStoreContext
    react
  • useCreateAtom
    react
  • useCreateStore
    react
  • useSelector
    react
  • useSetValue
    react
  • useAtom
    react
  • useStoreActions
    react
  • _useStore (experimental)
    react
  • useStore (deprecated)
    react
  • UseSelectorOptions
    react
Examples
  • Simple
    react
  • Atoms
    react
  • Stores
    react
  • Store Actions
    react
  • Store Context
    react
On this page
  • Function: createAtom()
  • Call Signature
  • Type Parameters
  • T
  • Parameters
  • getValue
  • options?
  • Returns
  • Call Signature
  • Type Parameters
  • T
  • Parameters
  • initialValue
  • options?
  • Returns

createAtom

Function: createAtom()

Call Signature

ts
function createAtom<T>(getValue, options?): ReadonlyAtom<T>;
function createAtom<T>(getValue, options?): ReadonlyAtom<T>;

Defined in: atom.ts:138

Type Parameters

T

T

Parameters

getValue

(prev?) => T

options?

AtomOptions<T>

Returns

ReadonlyAtom<T>

Call Signature

ts
function createAtom<T>(initialValue, options?): Atom<T>;
function createAtom<T>(initialValue, options?): Atom<T>;

Defined in: atom.ts:142

Type Parameters

T

T

Parameters

initialValue

T

options?

AtomOptions<T>

Returns

Atom<T>

Edit on GitHub

On this page

  • Function: createAtom()
  • Call Signature
  • Type Parameters
  • T
  • Parameters
  • getValue
  • options?
  • Returns
  • Call Signature
  • Type Parameters
  • T
  • Parameters
  • initialValue
  • options?
  • Returns
createAsyncAtom
createStore
Our Partners
Wow, it looks like you could be our first partner for this library! Chat with us!
TanStackStart
Full-document SSR, Streaming, Server Functions, bundling and more, powered by TanStack Router and Vite - Ready to deploy to your favorite hosting provider.
TanStackRanger
Headless, lightweight, and extensible primitives for building range and multi-range sliders.