Spacebars - Waiting for collection.find results


#1

I have seen thousands of answers regarding how to wait for Collection subscriptions. This is NOT about it ! I already have implemented ways to wait on subscription that are working fine.

The problem I am having is that AFTER subscriptions are ready. Eventually, it still takes some time for it to show Collections.find helper results. Either Find or the complex helper function operations are taking too long to come up with the results.

I have the following:

	{{#if allSubsReady}}
	    {{#if MyCollection.count}}
	            {{#each MyCollection}}
                       {{ShowMyResults}}
                    {{/each}}
            {{#else}}
                    <p> Your results are empty! </p>
            {{/if}}
        ...

The problem is that, for a few seconds, maybe more, specially on slow devices, it does show for quite a while “Your results are empty!”, even though there are results from the collection coming, whose query have not yet been processed. The problem is that, for the brief time the Empty warning goes off, customers got confused and give up on the purchase.

There are legitimate cases when count == 0 and no results should be shown.

Is there a way to wait for the query result or, rather, for the Helper function to be ready?