Non-stop flickering

I have what seems like a pretty straightforward template. When I run it locally it’s fine. When it runs on my remote server though there’s a nasty flickering that happens. The unordered list gets built over and over again. What could cause this?

Template.plans.helpers({
   all_plans: function() {
       return Plans.find({}, {sort: {start_date: -1}});
    }
});

<template name="plans">
    <ul>
      {{#each all_plans}}
        {{> plan }}
      {{/each}}
    </ul>
</template>

Looks like something is refreshing your Plans collection. You should put a breakpoint in the return (or any other area where Plan is modified) and trace the stack to see what is calling it. The code you’ve shown looks fine.

Try add .fetch() to the end of your find function. It’s better to return data at router level than in helper if they need to be reactive.

Never add .fetch() to the end of your find function, this makes Blaze rendering less effective. Never return data at router level, it is evil.

:- )

1 Like

Thanks for the pointers. Shall read more to clear confusion. :smile: