how to avoid .value from return value of a composable

here i have a composable export const useUser = () => { const { status, data } = useAuth(); const { $store } = useNuxtApp(); const user = computed(() => $store.state.user); return { loggedIn: computed(() => status.value === "authenticated"), user, }; }; for using it, i have to always type loggedIn.value how to use it just as loggedIn ?
3 Replies
manniL
manniL7mo ago
You don’t. It is a computed, so a read only ref under the hood. Using .value is correct (BONUS: instead of $store from useNuxtApp, I’d directly use the pinia store that was defined)
Sandrin Joy
Sandrin JoyOP6mo ago
we are using vuex, its a migration projct
manniL
manniL6mo ago
Ahh! That’s fine then 👌🏻
Want results from more Discord servers?
Add your server