Skip to content
LogoLogo

Store.defaultStore

Returns the default store for the current environment as a singleton.

  • Browser: sessionStorage
  • Server/unsupported: in-memory Map-based store

Returns the same instance on every call so that the zone transport and actions share the same store without explicit plumbing.

Usage

import { Store } from 'viem/tempo'
 
const store = Store.defaultStore()
 
await store.setItem('key', 'value')
const value = await store.getItem('key')
'value'

Return Type

type ReturnType = Store.Store

A singleton Store.Store instance for the current environment.