kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 193 forks source link

[FastRender plugin] Group Subscriptions do not work #587

Closed abecks closed 6 years ago

abecks commented 8 years ago

Configuring group-wide subscriptions does not work with the FastRender plugin:

var group = FlowRouter.group({
   name: 'FastRenderTest',
   subscriptions: function(){
      this.register('Subscription', Meteor.subscribe('Subscription'));
   },
   fastRender: true
});

group.route('/', {
   name: 'test',
});

Using FastRender.debugger.getPayload() shows that the collection was not populated by FastRender.

I am using a workaround for this:

function subscriptions(){
   this.register('Subscription', Meteor.subscribe('Subscription'));
}

var defaults = {
   subscriptions: subscriptions,
   fastRender: true
}

FastRender.route('/', _.extend({}, defaults, {
   name: 'test'
});