let’s say I have two simple models: Games
and Players
. Imagine Games
has an array called players
that is a unique set of player ids.
Meteor.publish('game', function (gameId) {
check(gameId, String);
let handle = Games.find(gameId).observe({
added: doc => this.added('games', doc._id, Object.assign(doc, {
players: Players.find({ _id: { $in: doc.players } }).fetch() // I know this isn't reactive.
})
});
this.ready();
this.onStop(() => handle.stop());
});
Is this bad practice? It would just be easier to publish to the client like this.