-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
[Question] computed value inst #558
Comments
Some components of VueGL are computed
|
In this project, ThreeJS native objects are stored in a computed function called
inst
.Knowing how big and complex those objects are, I guess they are stored this way for a reason.
My first guess was about removing VueJS observers on objects that doesn't required direct reactivity.
Obviously we don't need Vue to tell us about every single changes in this ThreeJS object.
The main reason for that is performance and by using a computed function it's a clever way to do so. (no-cached computed)
If that is the case, I would like to ask why don't we just declare the instance during
created()
?As explained in this post, var declaration on
this
during created doesn't provide reactivity !This trick is really useful on complex objects and also datas that get modified a lot in a few seconds (like live mouse position) and has a huge performance benefits for ThreeJS objects !
The text was updated successfully, but these errors were encountered: