big updats

This commit is contained in:
Daniel Ledda
2025-12-20 00:10:42 +01:00
parent a93ffff00d
commit 51e44db779
25 changed files with 570 additions and 203 deletions

View File

@@ -1,8 +1,7 @@
import { onMounted, onServerPrefetch, type ShallowRef, shallowRef } from "vue";
import useDJSSRContext from "@/useDJSSRContext.ts";
import useDjSSRContext from "@/useDjSSRContext.ts";
declare global {
// deno-lint-ignore no-var
var appstate: Partial<Record<string, unknown>>;
}
@@ -10,8 +9,8 @@ export default function useAsyncState<T>(
key: string,
getter: (context: { hostUrl: string }) => Promise<T | null>,
options?: { suspensible: boolean },
): { result: ShallowRef<T | null>; stateIsReady: Promise<unknown> } {
const ssrContext = useDJSSRContext();
): { result: ShallowRef<T | null>; done: Promise<void> } {
const ssrContext = useDjSSRContext();
const isClient = typeof ssrContext === "undefined";
const registry = ssrContext?.registry ?? globalThis?.appstate;
@@ -51,5 +50,5 @@ export default function useAsyncState<T>(
}
}
return { result: state, stateIsReady: promise };
return { result: state, done: promise };
}