Skip to content
LogoLogo

Store.memory

Creates an in-memory store backed by a Map. It supports atomic compareAndSet and removes expired compare-and-set values when they are read within the current process.

Usage

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

Return Type

type ReturnType = Store.Atomic

A Store.Atomic instance backed by an in-memory Map.