After playing a bit with vue.js I really like its computed properties and would like to see something similar in ViewModel.
Because the full render function of a component re-runs on each update, any methods used as part of the render function are constantly re-running even if none of their reactive dependancies have changed. This can be expensive. Vue's computed properties solves this problem.
Since using vue.js I've been achieving the same result in ViewModel by using autoruns like this:
After playing a bit with vue.js I really like its computed properties and would like to see something similar in ViewModel.
Because the full render function of a component re-runs on each update, any methods used as part of the render function are constantly re-running even if none of their reactive dependancies have changed. This can be expensive. Vue's computed properties solves this problem.
Since using vue.js I've been achieving the same result in ViewModel by using
autoruns
like this:This means that the expensiveFunctions are only re-run when their reactive dependencies change.
I'd love to see something like this built into ViewModel somehow!