I have Meteor.setInterval find one recent item in my collection and then sets it in a session every 1 seconds.
Meteor.setInterval(function() {
var entries = Database.findOne({}, { sort: { date: -1} });
Session.set('entryName', entries);
}, 1200);
I need this as it only gets the most recent entry and prevents flooding of other entries as it fires only once a second. Is there anyway of animating this (lets say add a fade effect)? Its a problem because if I animate to the interval, it will fade in and out every second, even if a new entry hasn’t been added.
I need it to fade only if the entry changes. Is there maybe a better way of rewriting the code in a Meteor way so its easier to animate?