zhao/imports/api/publications/players.js

9 lines
228 B
JavaScript

import { Meteor } from "meteor/meteor";
import Players from "../collections/Players.js";
Meteor.publish("players", (roomId) => {
if (roomId === undefined) {
return [];
}
return Players.find({ roomId });
});