mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

onReady/onError callback in a subscription #45

Closed navinSing closed 9 years ago

navinSing commented 9 years ago

How do we handle the onReady/onError callback in a subscription ? Asteroid.subscribe(name,arg, { onReady: ...

callbacks Function or Object Optional. May include onError and onReady callbacks. If a function is passed instead of an object, it is interpreted as an onReady callback.

http://docs.meteor.com/#/full/meteor_subscribe

pscanf commented 9 years ago

The Asteroid.subscribe method returns a subscription instance, which has a property ready, a promise which is fulfilled "on ready", and rejected "on error".

More details here.

Cheers!