I want to get data from Publish or alternative directly
// Severe
Meteor.pubAlternative('myPub', function (parameters ){
var data = [];
// do something
..........
return data;
});
// Client
// Check pub is ready and then
.......
var getData = Meteor. subAlternative();
You can publish collection which will consist of documents describing where to subscribe and on client react to changes in that 1 collection.
If you really have to react on such events thrown by server.
Meteor.publish('reports_sub', function (args) {
var pub = this;
var id = Random.id();
var data = {};
pub.added('reports', id, data);
someEvent(function (data) {
pub.changed('reports', id, data);
});
pub.ready();
});