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
Currently products and productTypes are exported as arrays, but they are used more often as maps. To prevent every consumer of the sdk having to reduce the products into an object, they should be exported as a map too.
// This can probably be made more type safe (e.g. product id's `as const`)
export const productsMap = generatedProducts.reduce((map, product: any) => {
map[product.id] = product;
return map;
}, {} as Record<string, any>);
The text was updated successfully, but these errors were encountered:
Currently
products
andproductTypes
are exported as arrays, but they are used more often as maps. To prevent every consumer of the sdk having to reduce the products into an object, they should be exported as a map too.The text was updated successfully, but these errors were encountered: