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

Elaborate on the backwards compatibility of subs.subscribe #7

Open
dandv opened this issue Jun 22, 2014 · 7 comments
Open

Elaborate on the backwards compatibility of subs.subscribe #7

dandv opened this issue Jun 22, 2014 · 7 comments

Comments

@dandv
Copy link
Contributor

dandv commented Jun 22, 2014

Related to the iron-router .wait() issue: How much of a drop-in replacement is subs.subscribe vs. Meteor.subscribe? For example, how does it handle the onError and onReady callbacks?

The code below works fine with this.subscribe(), but never completes with subs.subscribe():

onBeforeAction: function () {
  var user = Meteor.user();
  if (user) {
    Session.set('contentLoaded', false);
    this.subscribe('content-portfolio', user, function onReady() {  // user is a temporary placeholder for a more specific key in the user object
      Session.set('contentLoaded', true);  // PROBLEM: never here if this is replaced with subs
    });
  }
},
@arunoda
Copy link
Contributor

arunoda commented Jun 22, 2014

Nope. This is not possible yet. Need some core API changes.
But not impossible.

arunoda added a commit that referenced this issue Jun 22, 2014
Document limitations per issues #6 and #7
@wbashir
Copy link

wbashir commented Dec 17, 2014

@arunoda any updates to this and the onReady callback ?

@NullPtrEx
Copy link

Would really like this when subscriptions code on the server checks roles/permissions and the client code can then use the onError callback ...

@arunoda
Copy link
Contributor

arunoda commented Jan 16, 2015

Now you can pass onReady callback.
But I'm not sure it's semantics. Give it a try.

@faceyspacey
Copy link

what about onStop callback?

@oles
Copy link

oles commented Nov 23, 2015

I'd would really really love to see support for onError - or at least some examples on how to work around this limitation.

@arunoda got some hints on how I should approach this, if I were to try to implement it myself?
Going to try to tinker with https://github.com/kadirahq/subs-manager/blob/master/lib/sub_manager.js#L169 when I get the time :)

@Angular-Angel
Copy link

Huh. Is this still not fixed? Is there a more up to date version of this package? :/

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

7 participants