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

meta: use zustand for persistant state #202

Merged
merged 4 commits into from
Nov 18, 2024
Merged

Conversation

sehyunc
Copy link
Contributor

@sehyunc sehyunc commented Nov 18, 2024

This PR migrates persistent storage to zustand store with persist middleware from directly mutating cookies and localstorage. This provides a cleaner and more consistent API for getting/setting state. State is split up depending on if it needs to be present at Server Rendering time (ServerState) due to impact on LCP or if it can be hydrated after initial mount (ClientState).

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
trade ✅ Ready (Inspect) Visit Preview Nov 18, 2024 11:54pm
trade-mainnet-preview ✅ Ready (Inspect) Visit Preview Nov 18, 2024 11:54pm

@sehyunc sehyunc force-pushed the sehyun/zustand-persist-client branch from 81a635f to 246eb0e Compare November 18, 2024 23:50
@sehyunc sehyunc merged commit 5649f4c into main Nov 18, 2024
3 checks passed
@sehyunc sehyunc deleted the sehyun/zustand-persist-client branch November 18, 2024 23:55
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

Successfully merging this pull request may close these issues.

1 participant