© 2026 Hedgehog Software, LLC
const getUserId = () => props.userId; const uid = `${getUserId()}`; // caching refuses to work... // const uid = '8ed79db8-8d2a-4a95-a6d0-a55234e98f4fe'; // ...but this does const { data: tradesCommon, status: tradesStatus, error: tradesError } = useLazyAsyncData(`user-trades-with-${props.userId}`, () => { if (!isLoggedIn || isMe.value || props.userId === null) { return null; } const user = new User(authUser.id); return user.getTotalTradesWithUser(uid); }, { getCachedData: (key, nuxtApp) => { return nuxtApp.payload.data[key] || nuxtApp.static.data[key]; } });
Join the Discord to ask follow-up questions and connect with the community
Nuxt Community Chat Server
31,632 Members