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

Build in state management for carts using a SWR strategy #210

Open
ScopeyNZ opened this issue Nov 1, 2021 · 0 comments
Open

Build in state management for carts using a SWR strategy #210

ScopeyNZ opened this issue Nov 1, 2021 · 0 comments

Comments

@ScopeyNZ
Copy link
Contributor

ScopeyNZ commented Nov 1, 2021

It would be nice if we could have immediate cart state when a page renders by using browser local storage to save cart state. We could also apply a "stale while revalidate" strategy, where we show the stale data from local storage, but still go and fetch the cart from the server on load to ensure data is fresh.

Additionally, we could add in functionality to set the cart as "stale" (and refresh it) when a window regains focus, meaning carts will self-update if a customer has added items to their cart on a different tab.

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

1 participant