Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription #11

Open
SenerDemiral opened this issue Nov 18, 2015 · 0 comments
Open

Subscription #11

SenerDemiral opened this issue Nov 18, 2015 · 0 comments

Comments

@SenerDemiral
Copy link

// Client Main.jsx

shDD = Meteor.subscribe ('DD', null);

Meteor.startup(function() {
  let ddCC = 0;
  Tracker.autorun (function(computation) {
      // Subscription.ready() is reactive.
      if (shDD.ready()) {
        if (computation.firstRun) {
          return;  // ignore first empty run
        }

        ddCC += 1;  // to say something changed
        store.dispatch(Actions.ddChanged(ddCC));
      }
  });
});


// On different times

shDD = Meteor.subscribe ('DD', 'aaaaa');
...
shDD = Meteor.subscribe ('DD', 'bbbbb');
...
shDD = Meteor.subscribe ('DD', 'ccccc');

Tracker listens those 3 subscriptions.! Even handle different.
Related records are in minimongo. (Caching like subsManager)
Is there something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant