user3282341
user3282341

Reputation: 1

Seeing server data on the client

My code has the server create a collection and insert a bunch of documents. When a client starts up, it creates a new handle for the collection and immediately starts to use the data. However, the collection does not seem to have any of the documents the server had inserted. When I look at the collection in the debugger the documents are there. Of course, time has passed so maybe Meteor has synchronized by then. What is the best practice for "waiting" for server data to arrive at the client?

Upvotes: 0

Views: 43

Answers (1)

David Weldon
David Weldon

Reputation: 64312

The current best practice for waiting on documents is to use iron router's waitOn in your routes. You may also find this related post helpful.

Upvotes: 1

Related Questions