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.1.1/src/vanilla/utils/atomWithStorage.ts";

Properties

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