Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jotai/src/vanilla/utils/atomWithStorage.ts>AsyncStorage

👻 Primitive and flexible state management for React
Go to Latest
interface AsyncStorage
import { type AsyncStorage } from "https://deno.land/x/jotai@v2.0.4/src/vanilla/utils/atomWithStorage.ts";

Properties

getItem: (key: string) => Promise<Value | NO_STORAGE_VALUE>
setItem: (key: string, newValue: Value) => Promise<void>
removeItem: (key: string) => Promise<void>
optional
subscribe: (key: string, callback: (value: Value) => void) => Unsubscribe