title: Meteor keep old subscribed data until new subscribed date is ready
body: <p>My table flickers because my subscription is re-subbing in an autorun. When the subscribe is called again in the autorun, my data disappears and I have an empty table until the Data.find() runs again. How can I keep the data UNTIL the new data is ready?</p>
  
  <pre><code>Template.table.onCreated(function () {
    this.autorun(() =&gt; {
      if (Session.get('selectedItem') &amp;&amp; selectedSubItem.get()) {
        this.subscribe('dataOverview', Session.get('selectedItem'), selectedSubItem.get()._id);
      }
  });
  
  Template.table.helpers({
    collection () {
      return Data.find({"item._id": Session.get('selectedItem')._id, "subItem._id": selectedSubItem.get()._id});
    },
  </code></pre>
  
  <p>I also tried a different way, to see if it was actually a subscription data problem with the code below. The table is empty after the autorun, before the find runs a second time.</p>
  
  <pre><code>Template.table.onCreated(function () {
    this.autorun(() =&gt; {
      if (Session.get('selectedItem') &amp;&amp; selectedSubItem.get()) {
        this.subscribe('dataOverview', Session.get('selectedItem'), selectedSubItem.get()._id, () =&gt; {
          let cursor = Prjs.find({"app._id": Session.get('selectedApp')._id,"release._id": selectedRel.get()._id});
          this.tableData.set(cursor);
        });
      }
  });
  
  Template.table.helpers({
    collection () {
      return Template.instance().tableData.get();
    },
  });
  </code></pre>
  
  <p>From the <a href="https://guide.meteor.com/data-loading.html#publication-behavior-with-arguments" rel="nofollow noreferrer">meteor guide</a></p>
  
  <blockquote>
    <p>The server explicitly waits until all the data is sent down (the new
    subscription is ready) for the new subscription before removing the
    data from the old subscription. The idea here is to avoid flicker—you
    can, if desired, continue to show the old subscription’s data until
    the new data is ready, then instantly switch over to the new
    subscription’s complete data set.</p>
    
    <p>What this means is in general, when changing subscriptions, there’ll
    be a period where you are over-subscribed and there is more data on
    the client than you strictly asked for. This is one very important
    reason why you should always fetch the same data that you have
    subscribed to (don’t “over-fetch”).</p>
  </blockquote>
  
  <p>I want to "continue to show the old subscription's data until the new data is ready, then instantly switch over to the new subscription's complete data set" but how do I do that?</p>