import { create } from "zustand"; import { devtools, persist } from "zustand/middleware"; import { withSlices } from "zustand-slices"; import { makeIndexedDBStorage } from "./storage-indexdb.ts"; import { makeSlicedSerializerStorage } from "./storage-serializers.ts"; import { identitySlice, identitySliceSerializer } from "./store-ident.ts"; type SkypodState = ReturnType; const skypodStore = withSlices(identitySlice); const skypodStorage = makeIndexedDBStorage("skypod-state", 1); export const useSkypodStore = create( devtools( persist( skypodStore, { name: "skypod", storage: skypodStorage, }, ), { anonymousActionType: "@zustand/action", name: "skypod", }, ), );