You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using zustand for a large-scale app and it was a big relieve in terms of boilerplate next to redux, but there was still moments I felt repeating tasks (e.g. create a selector & action for each field of a store), compared to the one-line useState. Derived selectors and actions were also discussed multiple times here and are definitely a challenge for beginners.
So I've published zustand-x, a store factory which auto generates the hooks, getters and setters for each field of the store. It allows extending the selectors and actions to solve the mentioned challenge with, as the cherry on the cake, full type inference support.
I would love your feedback and I'm open to any kind of contributions (e.g. better support for middlewares), I generally review PRs in the same day.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been using zustand for a large-scale app and it was a big relieve in terms of boilerplate next to redux, but there was still moments I felt repeating tasks (e.g. create a selector & action for each field of a store), compared to the one-line
useState
. Derived selectors and actions were also discussed multiple times here and are definitely a challenge for beginners.So I've published zustand-x, a store factory which auto generates the hooks, getters and setters for each field of the store. It allows extending the selectors and actions to solve the mentioned challenge with, as the cherry on the cake, full type inference support.
I would love your feedback and I'm open to any kind of contributions (e.g. better support for middlewares), I generally review PRs in the same day.
Beta Was this translation helpful? Give feedback.
All reactions