-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Allow nested template.autorun calls #148
Comments
What would happen if the outer computation is invalidated in this case? Would it stop and and re-initiate a new inner computation or would it just create new computations for each re-run? |
Also, if that code would be equivalent with the code that you suggested, would the inner computation be destroyed with the template? |
So this is already implemented. The inner computation is recreated. This is how it works normally in Tracker. And yes, inner computation is destroyed with the template (as a consequence of outside computation being invalidated). So there is some cost of using nested autorun, but I do not see a reason to prevent it. It might not be good in your case to do it, because creating a computation does cost a bit, but there are also reasons (like computed field) when this is useful because you do want to cache an expensive computation inside another computation. |
Thanks, just wanted to know how this work s a bit closer :) |
For some reason this is not allowed. I do not understand why. I think something like this should be supported:
Ideally, the following would be equivalent:
But this would then be a solution for this as well: meteor/meteor#4494
The text was updated successfully, but these errors were encountered: