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

Functionality: Create a localStorage Hook that Removes an Item or Clears localStorage Entirely #44

Open
5 tasks
larkinds opened this issue Sep 11, 2023 · 0 comments

Comments

@larkinds
Copy link
Owner

larkinds commented Sep 11, 2023

Overview:
When a customer is using the website, we want to make sure that changes to their selection or account are properly tracked by the browser. This issue depends on #43 for determining how items are named when put into localStorage.

Action Items:

  • The hook deletes any previously set value in localStorage when requested
  • The hook updates the Context
  • The hook clears localStorage for all iceCreams on checkout
  • The hook uses JSON.stringify() and JSON.parse() to convert data to & from a string (since localStorage only supports strings)
  • The hook follows the [Rules of Hooks], and follows the naming convention for hooks

Resources:

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

No branches or pull requests

4 participants