You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Create a new Preact hook, useShopifyProduct(handle: string), that fetches and exposes product data from Shopify’s handle.js endpoint. This will allow components to easily retrieve and use Shopify product data by handle within the Preact application.
Acceptance Criteria:
Implement a hook useShopifyProduct(handle: string) in src/hooks/useShopifyProduct.ts.
The hook should fetch product data from /products/${handle}.js.
The hook should return loading, error, and product data states.
The hook should cache results per handle to avoid unnecessary network requests.
Add unit tests for the hook to cover loading, error, and success states.
Update documentation to describe usage of the new hook.