nate-strauser / wework

We Work Meteor, a job board and developer directory for Meteor specific work
https://www.weworkmeteor.com
MIT License
288 stars 145 forks source link

fix for Router.ready() #17

Closed comerc closed 9 years ago

comerc commented 9 years ago

Why unmerged? 😆

nate-strauser commented 9 years ago

i'm refactoring the app currently...

also i'm not sure a this.ready() check is really needed - the guide doesn't show anything like that https://github.com/EventedMind/iron-router/blob/devel/Guide.md#rendering-templates-with-data

On Tue, Jan 27, 2015 at 11:50 AM, comerc notifications@github.com wrote:

Why unmerged? [image: 😆]

— Reply to this email directly or view it on GitHub https://github.com/nate-strauser/wework/pull/17#issuecomment-71682271.

comerc commented 9 years ago

https://github.com/EventedMind/iron-router/blob/e1666f5cdd2139b63dbc23b28d21d029387832a5/Guide.md#the-waiton-option

When router renders a loadingTemplate, this.ready() is false.

nate-strauser commented 9 years ago

correct - so this.ready() would be needed if we used subscribe, but since we use waitOn we don't need to do that

from the guide

Another alternative is to use waitOn instead of subscribe. This has the same effect but automatically short-circuits your route action and any before hooks (see below), and renders a loadingTemplate instead.
comerc commented 9 years ago

You may try use console.log for this.ready()

comerc commented 9 years ago

You are right. Sorry. 😇