Im really new in meteor and I realized that sometimes in client side the data is not complete (apparently), so many times I have had to use setTimeout function to put a little delay and wait for it, before doing something.
I have faced this situation with some libraries and onrendered event too.
How can I avoid this situation ? Is this normal ?
Tip: At the moment Im not using publish and subscribe, maybe this could solve the first case.
The only place where we needed to do that was in onRendered as the browser has not completely rendered the DOM (or maybe jQuery has not yet run its magic). Personally I use _.defer(function() { }) and only use timeouts when there is a real delay somewhere I can’t get around (can’t think of any at the moment, but they are exceptions not the rule).
You are right, definitely a hack and should not be necessary. If either of you have an open repository or a reproduction of the issue I’d be more than happy to take a look.