diff --git a/packages/hooks/src/queries/cart.ts b/packages/hooks/src/queries/cart.ts index d62e76a..412af3a 100644 --- a/packages/hooks/src/queries/cart.ts +++ b/packages/hooks/src/queries/cart.ts @@ -133,6 +133,7 @@ export const useOptimisticCartUpdate = ({ const optimisticUpdate = React.useMemo(() => { let snapshot: Cart | null | undefined = undefined return { + get: () => snapshot, update: async (newCart: Cart) => { await queryClient.cancelQueries(cartQueryKey) snapshot = queryClient.getQueryData(cartQueryKey)