DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Get started

OverviewReactivityData FetchingGlobal Stores

Primitives

Creating SignalsCreating QueriesCreating MutationsComputing Signal ValuesCreating EffectsContextual Signal StoresBatch UpdatesCleanup EffectsUntrack Signals

Hooks

Using QueriesUsing MutationsReading Primitive SignalsUsing SignalsUsing Store Instances

Components

Reactive Text

Using Store Instances

Learn how to use instances of stores as an alternative to Context.

  • source
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page
import { useStore } from '@cerberus/signal'

Usage

When you want to use a unqiue instance of a global Store but do not need a Context API.

Using the Store

Simply pass in a store to the useStore hook and recieve a memoized version of it - protected against re-renders.

Loading example...

For more information about stores, see the Stores page.

API

useStore accepts the following options:

ParamsRequiredDescription
storeYesThe store function reference to call.

Return

useStore returns a memoized version of the store value (e.g., what the store returns);

On this page

  • Usage
  • Using the Store
  • API
    • Return
Edit this page on Github

Count: 0

Render Count: 0