This commit is contained in:
Dan Ditomaso
2025-03-24 15:37:51 -04:00
parent 5a142e671d
commit 0d6c5878fc
12 changed files with 484 additions and 3727 deletions
+14
View File
@@ -0,0 +1,14 @@
import { StateStorage } from "zustand/middleware";
import { get, set, del } from "idb-keyval";
export const zustandIDBStorage: StateStorage = {
getItem: async (name: string): Promise<string | null> => {
return (await get(name)) || null;
},
setItem: async (name: string, value: string): Promise<void> => {
await set(name, value);
},
removeItem: async (name: string): Promise<void> => {
await del(name);
},
};