iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 413 forks source link

Using extern DDP Connection with this.subscribe does not work #1469

Closed TimoRuetten closed 8 years ago

TimoRuetten commented 8 years ago

When taking a look into the code you can see that it seems not to be possible to add this.subscribe when you want to subscribe a external DDP publish method.

This is what I tried to do:

MyConnection = DDP.connect('meteor.com');

In my route: MyConnection.subscribe('test').wait();

Of course this will not work because only this.subscribe() will extend the subscription method with wait(). Is there any recommended way to solve this with iron:router ?

Yes: I am able to add MyConnection.subscribe('test') to the waitOn method but I realy want to do this in my route callback function - because I have to work with a bit of logic and other subscriptions which is not possible in this way in the waitOn method.

TimoRuetten commented 8 years ago

It seems to work when I work with this.wait().

this.wait(MyConnection.subscribe());