big updats
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user