mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
16 lines
456 B
TypeScript
16 lines
456 B
TypeScript
import type { LysandClient } from "@lysand-org/client";
|
|
import { StorageSerializers } from "@vueuse/core";
|
|
|
|
// Return type of LysandClient.getInstance
|
|
export type Instance = Awaited<ReturnType<LysandClient["getInstance"]>>["data"];
|
|
|
|
export const useInstance = () => {
|
|
if (process.server) {
|
|
return ref(null);
|
|
}
|
|
|
|
return useLocalStorage<Instance | null>("lysand:instance", null, {
|
|
serializer: StorageSerializers.object,
|
|
});
|
|
};
|