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

Stock Center Cart Persistence #952

Open
ktun95 opened this issue Jan 17, 2025 · 0 comments
Open

Stock Center Cart Persistence #952

ktun95 opened this issue Jan 17, 2025 · 0 comments

Comments

@ktun95
Copy link
Collaborator

ktun95 commented Jan 17, 2025

The cart is currently not persisted between page loads.

  • Cart state is managed using jotai atoms
  • atomWithStorage can be used to create an atom whose value is persisted in browser
    • a custom storage implementation can be provided which allows us to use localForage + IndexedDB

Concerns

localForage is async

  • Derived atoms of cartAtom will have to be adapted to deal with promises
  • Updating atom values must be changed to async
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