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

Create a JavaScript Datastore class #3

Open
louwie17 opened this issue Nov 16, 2021 · 0 comments
Open

Create a JavaScript Datastore class #3

louwie17 opened this issue Nov 16, 2021 · 0 comments

Comments

@louwie17
Copy link
Owner

Create a JavaScript Datastore class which will save data to localStorage.

Helpfull links: https://www.w3schools.com/js/js_classes.asp, https://www.w3schools.com/jsref/prop_win_localstorage.asp

  • Create the class with several helper methods for saving the data and retrieving the data.
  • We should be able to give the class a custom key that is used for saving in localStorage.
  • export a instantiated productDataStore that we can use in our React components

To allow for easy testing you could set the class to the global window object, this is accessible in your browser console.

Bonus:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant