cachePredictor
Build a line predictor that looks merchandise up via a host-supplied KV getter (e.g., a product cache keyed by variant id). The returned partial merchandise is merged onto a minimal placeholder so the cache only needs to provide the fields it actually knows.
Signature
function cachePredictor(opts: { get: (variantId: string) => Partial<CartLineMerchandise> }): LinePredictor;Parameters
| Name | Type | Description |
|---|---|---|
opts | { get: (variantId: string) => Partial<CartLineMerchandise> } |
Returns
A that yields Partial<CartLine> on cache
hit and null on miss or for non-add-line mutations.
Related
CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions
BuyerIdentityActions
Buyeridentity sync method added to when CartCapabilities.buyerIdentity is true. Fires when the auth bridge detects a changed identity so the adapter can associa
CartActions
Full action surface for a cart, assembled from and capabilitygated mixin types. Pass the same C as the kernel snapshot's capabilities to receive a correctly nar