createStoreHook helper function for @xstate/store/react #5298
Unanswered
matthewdavi
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've found the DX of zustand creating a bound hook automatically for each store to be very ergonomic and pleasant. I also quite like @xstate/store and its type inference + structure around events.
But I've been confused as to why I need to pass in the store as the first argument to
useSelector
. This seems like a downgrade from the DX zustand offers. I've written this function for use in my app, and I'm wondering if this is an antipattern, or whether it's a good enough idea that it could be exposed as a helper function from the@xstate/store/react
package.Beta Was this translation helpful? Give feedback.
All reactions