According to the Meteor documentation, template.data :
This property provides access to the data context at the top level template. It is updated every time you re-render the template. Access is read-only and non-reactive .
Since we know that the current data context is reactive , therefore, it can change without re-rendering the template (this is what makes reactivity look beautiful and smooth Blaze), this if written to check if the "real" current terms have changed (which are stored in reactive Template.currentData() ) compared to the βpreviousβ terms that we had the last time the current template was made . (stored in non-reactive template.data )
To complete this, what does this autostart do:
- At any time, the current data context changes ...
- Get conditions from the specified data context
- Compare these terms with those that were saved in
template.data when rendering the template - If they differ from each other, it means that the terms have changed (duh): reset post-limit.
Sylvainb
source share