Replies: 2 comments 1 reply
-
In another discussion (#161), there was a recommendation to use function definitions + This approach appears to solve the dependency order issue. I realized I could take that a step further and use getters so I don't have to make a function call and get the same
So far in my testing this appears to work. Are there any gotchas I should be aware of with this approach? Or would this be the recommended workaround? One issue I'm not sure how to fix is that it doesn't seem possible to memoize the computation of these values so |
Beta Was this translation helpful? Give feedback.
-
I guess if you can create two separate derived proxies, it should work.
Hmm. No, we don't want to add another complexity. If we find a solution without changing the API, it's worth to consider. |
Beta Was this translation helpful? Give feedback.
-
The docs are clear that derived values must declare dependencies first:
I also noticed while this comment is in the
proxyWithComputed
documentation, the limitation also applies toderive
(which makes sense).I have a use case where I can't guarantee the order of computed values as the keys are defined at runtime from an external source.
My questions are:
Here is a simplified example of what I want to accomplish:
Codesandbox example
As a proposal, would something like a
defer
wrapper be possible? Where a computed value inderive
could be computed at property access time instead of derivation time?Pseudo-code proposal:
Beta Was this translation helpful? Give feedback.
All reactions