Getter called five times on each proxy object update #872
-
Hello. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
class getters are handled as just function call on the prototype chain. Though, five times sounds a bit too many. Not sure how it could be improved. |
Beta Was this translation helpful? Give feedback.
-
Thank you for quick response and example, gonna use plain objects instead of classes then. |
Beta Was this translation helpful? Give feedback.
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.