One subscribe depend on another subscribe


#1
@DetailController = RouteController.extend
  waitOn: ->
    return [
      Meteor.subscribe('books', {id: parseInt(@params.id)}, {})

      Meteor.subscribe('booksDetail',{id:bookId})#the bookId must wait books is ready

    ]

what’s the best practice ?one subscribe must wait another subscribe ready?


#2

what is bookId where you define it? If you want to fetch current book details I guess you should make it like this:

@DetailController = RouteController.extend
  waitOn: ->
    return [
      Meteor.subscribe('books', {id: @params.id})
      Meteor.subscribe('booksDetail',{bookId: @params.id})
    ]

It is not clear how booksDetails are related to books


#3

First question would be can the fields of book details simply be fields of the books collection? If not, take a look at this package: