When the app starts I want to get a bulk of data from the db, do stuff with it, and only when I finish render the view. Is it possible? I do not use iron router since it is a single page app.
Right now I have simply var data = Data.findOne({})
in client/main.js
but the problem is that when I use data
in a template, sometimes it is there but sometimes I get undefined
. How do I make sure everything runs only when the data is there?