hanseaston / pandemic-produce-delivery-project

An open-source e-commerce shop using React, Express, Firebase, and MongoDB. Designed for pandemic-relief and social good. The project is no longer actively maintained, but feel free to fork and use for your own purpose!
MIT License
26 stars 38 forks source link

Local Storage #8

Open hanseaston opened 4 years ago

hanseaston commented 4 years ago

Right now, if I refresh the page, all of the cart's content will be gone. That would end up being a really bad user experience. At least, I want my cart items to preserve if I accidentally refresh the page, or even when I close or reopen the tab. So, maybe sessionstorage or localstorage would be better for this to happen. I am leaning more towards localstorage, and maybe this npm package will help. Or maybe, whenever user updates their cart, we want to directly write the cart content directly to the database? What do people think? Would that be too inefficient to do so?

jagnani73 commented 4 years ago

Do you have a backend linked with the project? Because it's better to use a backend instead of the localstorage or a sessionstorage

gitaalekhyapaul commented 4 years ago

@hanszhang00 We can make a cart model, and work on it. Since I saw that in issue #33 you mention reorganising the project into microservices, I can help you with that and it can be a starting point into doing that!