I’ve got a non-reactive helper which works as expected but I like to have some properties reactives.
This is my model:
const food = Food.find({}, {reactive: true}, {
sort: this.sort
}).fetch().map(food => {
const owner = Meteor.users.findOne(food.owner, {fields: {username: 1, avatarS: 1, following: 1}});
food.avatarS = owner && owner.avatarS;
food.username = owner && owner.username;
if (food.likes.indexOf(Meteor.userId()) == -1) {
// user did not like this plate
food.liked = false;
} else {
// user liked this plate
food.liked = true;
}
return food;
});
So if I publish new data in Food I don’t want to refresh the content (and it’s not refreshing) but I’d like to refresh the value for food.liked.
Would be this possible?
BTW: If I have reactive: false it doesn’t work (I always get 0 elements), so if I don’t want reactive I have to put true (??)
Thanks in advance