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

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

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

Parameters

validator: (value: unknown) => value is Value

Returns

{ (storage: AsyncStorage<unknown>): AsyncStorage<Value>; (storage: SyncStorage<unknown>): SyncStorage<Value>; }