-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add initial support for xstate/store/solid #5056
Conversation
🦋 Changeset detectedLatest commit: 4136506 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
de5769f
to
ad3f388
Compare
ad3f388
to
f4b00c2
Compare
Apologies for the force pushes; I can move this to a clean branch with a single commit instead if they're a problem. |
* previously selected value | ||
* @returns A read-only signal of the selected value | ||
*/ | ||
export function useSelector<TStore extends Store<any, any>, T>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially went with the name createSelector
, and I might actually prefer it. I'm not sure what the consensus is on naming functions like this in SolidJS. The library itself has use*
as well as create*
naming conventions for functions like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, whatever is most idiomatic!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just noticing the other solid-related code uses useActor
and useMachine
for example so I think this makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this!
You're welcome! I really enjoyed this process and I'm stoked to contribute to XState. |
I've added
useSelector
support to xstate/store for SolidJS which seems to be working well in my tests. Let me know what I can improve and I'd be happy to do it.