Skip to content

Getter called five times on each proxy object update #872

Closed Answered by dai-shi
crabvk asked this question in Bug report
Discussion options

You must be logged in to vote

class getters are handled as just function call on the prototype chain.
Valtio doesn't cache prototype function call.
On the other hand, object getters are cached. Here's the modified example: https://stackblitz.com/edit/github-utfgww

Though, five times sounds a bit too many. Not sure how it could be improved.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by crabvk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants