Open hanseaston opened 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
@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!
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?