Kurounin / Pagination

This package allows you to paginate the subscriptions over meteor's collections. It can be used in a Blaze template or in ReactJS.
MIT License
56 stars 22 forks source link

Question: can these subscriptions be "unblocked"? #100

Closed carlosalvidrez closed 3 years ago

carlosalvidrez commented 3 years ago

My method calls are for some reason waiting for these subscriptions/paginations to be ready. Is there a way to have method calls NOT have to wait for these paginations?

Thanks! Carlos

Kurounin commented 3 years ago

Is this happening client side?

carlosalvidrez commented 3 years ago

Yes. The method call happens on the client and so do the subscriptions/paginations.

The method is a server method that goes out and fetches data... it is always waiting for the paginations to be done before starting.

Thanks

carlosalvidrez commented 3 years ago

BTW, this Meteor doc seems to speak to the root of the matter... wondering if it sheds any light into this too, and if what we'd have to do is have the pagination package call this.unblock() before every subscription (which it manages internally I believe)... https://galaxy-guide.meteor.com/apm-managing-waittime.html#Using-this-unblock

Kurounin commented 3 years ago

According to the documentation link you sent this is standard behavior, in that all subscriptions block until ready. If you wish to unblock this call you could do this in your server side publication, after installing meteorhacks:unblock by overriding the transform_options:

publishPagination(MyCollection, {
    transform_options: function (filters, options) {
        this.unblock();

        return options;
    }
});
carlosalvidrez commented 3 years ago

Worked like a charm, thanks!!!