//useMyHook.tsx
const getData = query(async () => {
"use server";
return { user: 1 };
}, "data");
export function useMyHook() {
const res = createAsync(() => getData());
return {
user: () => {
console.log("I'm am called and logged all the time!")
return res()?.user,
}
};
}
//useMyHook.tsx
const getData = query(async () => {
"use server";
return { user: 1 };
}, "data");
export function useMyHook() {
const res = createAsync(() => getData());
return {
user: () => {
console.log("I'm am called and logged all the time!")
return res()?.user,
}
};
}