Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

autopublish in leaderboard

  • Loading branch information...
commit cb14d116e090e783b8eac63f6c908d826f806698 1 parent bc05e41
@debergalis debergalis authored
View
2  examples/leaderboard-remote/client/leaderboard-remote.js
@@ -3,8 +3,6 @@ Leaderboard = Meteor.connect("http://leader2.meteor.com/sockjs");
// XXX I'd rather this be Leaderboard.Players.. can this API be easier?
Players = new Meteor.Collection("players", Leaderboard);
-Leaderboard.subscribe("top10");
-
Template.main.events = {
'keydown': function () {
Session.set("error", null);
View
1  examples/leaderboard/.meteor/packages
@@ -4,3 +4,4 @@
# but you can also edit it by hand.
jquery
+autopublish
View
8 examples/leaderboard/leaderboard.js
@@ -5,9 +5,6 @@ Players = new Meteor.Collection("players");
/*** Client ***/
if (Meteor.is_client) {
- // Get the top 10 players from the server, updated continuously.
- Meteor.subscribe("top10");
-
$(document).ready(function () {
// List the players by score. You can click to select a player.
var scores = Meteor.ui.renderList(Players.find({}, {sort: {score: -1}}), {
@@ -54,11 +51,6 @@ if (Meteor.is_client) {
// subdirectory named 'server'.
if (Meteor.is_server) {
- // Publish the top 10 players, live, to any client that wants them.
- Meteor.publish("top10", {collection: Players,
- sort: {score: -1},
- limit: 10});
-
// On server startup, create some players if the database is empty.
Meteor.startup(function () {
if (Players.find().count() === 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.