A client that reads and displays favourite tweets from a local JSON file.
Note: This README is in Markdown language.
Peter Le Bek - c2lebekp
Kevin Dial - c0dialke
// OLD FUNCTION | |
const findSKUFromVariant = (productItem, variant) => { | |
return productItem.skus.find(sku => sku.variant.color === variant.color) | |
}; | |
// NEW FUNCTION | |
const findSKUFromVariant = (productItem, variant) => { | |
// compare sku item based on new varient and previously set varients |
// source: https://stackoverflow.com/a/59843241 | |
const usePrevious = (value, initialValue) => { | |
const ref = React.useRef(initialValue); | |
React.useEffect(() => { | |
ref.current = value; | |
}); | |
return ref.current; | |
}; |