Break dependency between livedata and mongo-livedata

This commit is contained in:
matt debergalis
2012-03-14 16:30:06 -07:00
parent 26a9236160
commit bb575138e5

View File

@@ -440,10 +440,14 @@ _.extend(Meteor._LivedataSession.prototype, {
var res = handler.apply(sub, params || []);
// automatically wire up handlers that return a Cursor.
// otherwise, the handler is completely responsible for delivering
// its own data messages and registering stop functions.
if (res instanceof _Mongo.Cursor) // XXX generalize
// if Meteor._RemoteCollectionDriver is available (defined in
// mongo-livedata), automatically wire up handlers that return a
// Cursor. otherwise, the handler is completely responsible for
// delivering its own data messages and registering stop
// functions.
//
// XXX generalize
if (Meteor._RemoteCollectionDriver && (res instanceof Meteor._Mongo.Cursor))
sub._publishCursor(res);
},