Skip to content

Commit 73e9258

Browse files
committed
feat: use useState instead of ref
1 parent 8469ef9 commit 73e9258

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/shopify/composables/useShopifyCart.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
const cart = ref<ShopifyCart>(undefined)
2-
const isCartOpen = ref(false)
3-
41
export const useShopifyCart = () => {
2+
const cart = useState<ShopifyCart>('cart', () => undefined)
3+
const isCartOpen = useState('isCartOpen', () => false)
54
const nuxtApp = useNuxtApp()
6-
const loading = ref(false)
5+
const loading = useState('loading', () => false)
76
const toast = useToast()
87

98
const getPriceWithCurrency = (price?: ShopifyPrice | null, quantity: number = 1) => {

0 commit comments

Comments
 (0)