react-ecommerce icon indicating copy to clipboard operation
react-ecommerce copied to clipboard

Persist cart on refresh

Open mattpauls opened this issue 2 years ago • 1 comments

Addresses #2

I'd love some feedback on this one, if possible. I wasn't sure if I should put updating localStorage in an onClick() or whether to use a useEffect. Using the onClick method, at least the way I was implementing it, would mean I'd have to have the same code in two locations, but onEffect reads from disk more than I think is necessary. (I added some comments in the code)

mattpauls avatar Feb 24 '23 14:02 mattpauls

Hi @mattpauls 👋

I see you've completed 3/5ths of the issues. Let me know if you need any help!

sbmsr avatar Mar 21 '23 16:03 sbmsr