-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
A util method to add computed to state #86
Comments
Hey, this is interesting. Can we drop proxyWithComputed if we support chaining addComputed? |
Maybe not. I don’t have an idea yet to support nested computeds with addComputed. |
If it's possible to add multiple computeds in a single call, I'd say yes |
OK, I might need to change a signature significantly. It's more for #85. Let's see how you like it. |
Hmm, my challenges are not very successful. https://github.com/pmndrs/valtio/tree/feat/add-computed https://github.com/pmndrs/valtio/tree/feat/add-computed-2 In either case, nested computed is tricky with typescript. Is there a real use case to add computed afterward? |
@dai-shi IMO the first branch accomplishes the feature, although not as you'd like (deprecating proxyWithComputed) Real use cases:
|
Right now it's natural to add a reactive property to a proxified state object, what's missing is a util method for doing the same with computed:
The text was updated successfully, but these errors were encountered: