Search code examples
meteormeteor-blaze

Meteor stop template updating after onRendered


Can Meteor stop a template from reactively updating itself after the initial render.

I have an app which displays images in a template. But I don't want any additional images that have been inserted into the collections to appear in the template unless the user does a reload.

In my template's helper I get the images by:

var usersImages = Meteor.users.find({_id:{$ne: userID}},{ImagesUploaded: {$elemMatch: {editStatus:true}}}).fetch();

How can I now prevent further images being added to the template now?


Solution

  • You can tell your query to be non reactive by adding {reactive:false} as an option in the query

    return var usersImages = Meteor.users.find({_id:{$ne: userID}},{ImagesUploaded: {$elemMatch: {editStatus:true}},{reactive:false}}).fetch();
    

    More info in the docs http://docs.meteor.com/#/full/find, (You can only use this client side)