-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
feat(utils): devtools dispatch support #260 #261
Conversation
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
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.
Looks great.
Awesome! Thanks guys! Appreciate it! 😃 👍 |
Oh, codesandbox bot is not working. |
Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2dcef56:
|
@AshConnolly Please try the codesandbox ci build, and make sure if this fixes what you want. You can install the build locally. |
Thanks so much for this @dai-shi & @Aslemammad! Appreciate it! Sorry for taking so long to get back to this! I just tested it on Codesandbox and couldn't get it to work. What shape should the dispatch object be?
but got this error: Sandbox here - https://codesandbox.io/s/react-forked-rhp1s?file=/src/App.js In terms of the PR, you made this change look simple, I might even try and contribute next time I want a feature! (I'm sure its not as simple as it looks though!!) Thanks again! 😄 |
I never tried, but it's probably this: {"text":"bye"} |
So sorry for the late reply! Thanks so much! 👍 This change solves the issue of changing Valtio state from a dev tool which is great. However, I have a kind of related question that I hinted at here... Is it possible to have some sort of Valtio implementation that allows us to change Valtio state from react dev tools? I often wonder if people are hesitant to use state libraries that don't clearly show state in devtools. Like with context you can see and modify context state in the react devtools, which is nice. Happy to raise this as a separate issue / discussion if it helps! Thanks again! 😄 |
Feel free to open a new issue / discussion. Maybe discussion, as we don't know if it's possible yet? |
Fantastic! Thanks so much @dai-shi & @Aslemammad! 😃 👍 |
Thanks @AshConnolly for bringing ideas from other places to here. I really think Valtio has a bright future! Taking the best ideas from other state management solutions and bringing it here. |
Here's a simple impl of the feature! Any suggestions/reviews are welcome.
Reminder: we discussed
eval
/new Function
for simple js values instead of JSON values, but it's risky for now. So it's good to go with JSON for nowcc @AshConnolly