šŸ“„ tanstack/store/latest/docs/reference/interfaces/storeoptions

File: storeoptions.md | Updated: 11/15/2025

Source: https://tanstack.com/store/latest/docs/reference/interfaces/storeoptions



TanStack

Store v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

API Reference

Examples

Framework

React logo

React

Version

Latest

Menu

Getting Started

API Reference

Examples

On this page

StoreOptions

Copy Markdown

Interface: StoreOptions<TState, TUpdater>
=========================================

Defined in: store.ts:5

Type Parameters
---------------

• TState

• TUpdater extends AnyUpdater = (cb) => TState

Properties
----------
### onSubscribe()?

ts

optional onSubscribe: (listener, store) => () => void;


optional onSubscribe: (listener, store) => () => void;

Defined in: store.ts:18

Called when a listener subscribes to the store.

#### Parameters ##### listener

Listener<TState>

##### store

Store <TState, TUpdater>

#### Returns

Function

a function to unsubscribe the listener

##### Returns

void


### onUpdate()?

ts

optional onUpdate: () => void;


optional onUpdate: () => void;

Defined in: store.ts:25

Called after the state has been updated, used to derive other state.

#### Returns

void


### updateFn()?

ts

optional updateFn: (previous) => (updater) => TState;


optional updateFn: (previous) => (updater) => TState;

Defined in: store.ts:12

Replace the default update function with a custom one.

#### Parameters ##### previous

TState

#### Returns

Function

##### Parameters ###### updater

TUpdater

##### Returns

TState

Edit on GitHub

Classes / Effect

Interfaces / DerivedOptions

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics