-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Experimented Zustand frontend store #24896
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24896 +/- ##
==========================================
- Coverage 71.43% 71.38% -0.06%
==========================================
Files 1531 1530 -1
Lines 116067 116041 -26
Branches 13973 13972 -1
==========================================
- Hits 82918 82834 -84
- Misses 32158 32200 +42
- Partials 991 1007 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adding simplest possible store for only notes as the first step for migration. The store contains the following: - byId - stores generalized notes by id - lists - stores different lists rendering notes (e.g. feed, likes:index, profile:index etc) - replaceList - adds first load of notes from the backend result to the store - appendToList - appends following paginated notes to the store - toggleLike - toggles like optimistically
This hook contains logic for mutation and invalidation for the like action. This helps separating backend endpoint logic from the store
Instead of mutating directly in FeedItemStats, it uses the newly added separate hook for the like action
It helps debugging what is added where in the store
This helps reducing the usage of frontend mapping for activity type for future migration. To make it possible to use the existing components, selectors convert Post -> Activity at the edge (single place)
c5c5617 to
44b671c
Compare
No description provided.