Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdixon committed Nov 22, 2024
1 parent f6a35c5 commit 5f739bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/hydrogen/src/pagination/Pagination.multiple.example.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {json, type LoaderArgs} from '@shopify/remix-oxygen';
import {json, type LoaderFunctionArgs} from '@shopify/remix-oxygen';
import {useLoaderData, Link} from '@remix-run/react';
import {getPaginationVariables, Pagination} from '@shopify/hydrogen';
import {type Collection} from '@shopify/hydrogen-react/storefront-api-types';

export async function loader({request, context: {storefront}}: LoaderArgs) {
export async function loader({
request,
context: {storefront},
}: LoaderFunctionArgs) {
const womensPaginationVariables = getPaginationVariables(request, {
pageBy: 2,
namespace: 'womens', // Specify a unique namespace for the pagination parameters
Expand All @@ -13,10 +17,10 @@ export async function loader({request, context: {storefront}}: LoaderArgs) {
});

const [womensProducts, mensProducts] = await Promise.all([
storefront.query(COLLECTION_PRODUCTS_QUERY, {
storefront.query<{collection: Collection}>(COLLECTION_PRODUCTS_QUERY, {
variables: {...womensPaginationVariables, handle: 'women'},
}),
storefront.query(COLLECTION_PRODUCTS_QUERY, {
storefront.query<{collection: Collection}>(COLLECTION_PRODUCTS_QUERY, {
variables: {...mensPaginationVariables, handle: 'men'},
}),
]);
Expand Down

0 comments on commit 5f739bf

Please sign in to comment.