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
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)
we are using vuex, its a migration projct
Ahh! That’s fine then 👌🏻