Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localstorage usage #37

Open
designaky opened this issue Nov 5, 2021 · 1 comment
Open

Localstorage usage #37

designaky opened this issue Nov 5, 2021 · 1 comment
Labels
compliment enhancement New feature or request

Comments

@designaky
Copy link

Very good usage of the local storage for the persistent data, but at the same is always good to think of the best data structure to store the data. In this case, if your website ends up with a lot of products, it might be more efficient to have a good array of objects so that you only retrieve just one array for all the data, the process it a little bit longer because you will need to parse to JSON the array before storing it and parse it back when you are retrieving it but It will allow you to managed more products and information without issues.

@designaky designaky added enhancement New feature or request compliment labels Nov 5, 2021
@designaky
Copy link
Author

You can even store more information about the product like the quantity

[ { productName: "hello", quantity: 2}, { productName: "world", quantity: 3} ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compliment enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant