mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-22 00:43:50 +01:00
(fix) types
This commit is contained in:
parent
d7805f7c4c
commit
9c1dfb304f
@ -1,8 +1,10 @@
|
|||||||
export function useGAsyncData(...params: Parameters<typeof useAsyncData>) {
|
type KeysOf<T> = Array<T extends T ? keyof T extends string ? keyof T : never : never>;
|
||||||
|
|
||||||
|
export function useGAsyncData<ResT, DataE = Error, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>(...params: Parameters<typeof useAsyncData<ResT, DataE, DataT, PickKeys, DefaultT>>): ReturnType<typeof useAsyncData<ResT, DataE, DataT, PickKeys, DefaultT>> {
|
||||||
if (!params[2]) {
|
if (!params[2]) {
|
||||||
params[2] = {};
|
params[2] = {};
|
||||||
}
|
}
|
||||||
params[2].getCachedData = (key) => useNuxtData(key).data.value ?? null;
|
params[2].getCachedData = (key) => useNuxtData(key).data.value ?? null;
|
||||||
|
|
||||||
return useAsyncData(...params);
|
return useAsyncData<ResT, DataE, DataT, PickKeys, DefaultT>(...params);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user