Skip to content

Commit

Permalink
bugfix(multiple-subscribers): Attempt to fix the multiple subscribers…
Browse files Browse the repository at this point in the history
… issue
  • Loading branch information
dotansimha committed Oct 25, 2016
1 parent e79af51 commit ace9c78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/ObservableCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export var MongoObservable;
};
Collection.prototype.find = function (selector, options) {
var cursor = this._collection.find.apply(this._collection, arguments);
return ObservableCursor.create(cursor);
return ObservableCursor.create(cursor).publish().refCount();
};
Collection.prototype.findOne = function (selector, options) {
return this._collection.findOne.apply(this._collection, arguments);
Expand Down
2 changes: 1 addition & 1 deletion dist/bundles/index.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ var ObservableCursor = (function (_super) {
};
Collection.prototype.find = function (selector, options) {
var cursor = this._collection.find.apply(this._collection, arguments);
return ObservableCursor.create(cursor);
return ObservableCursor.create(cursor).publish().refCount();
};
Collection.prototype.findOne = function (selector, options) {
return this._collection.findOne.apply(this._collection, arguments);
Expand Down
2 changes: 1 addition & 1 deletion src/ObservableCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export module MongoObservable {
}): ObservableCursor<T> {
const cursor = this._collection.find.apply(
this._collection, arguments);
return ObservableCursor.create<T>(cursor);
return ObservableCursor.create<T>(cursor).publish().refCount();
}

findOne(selector?: Selector | ObjectID | string, options?: {
Expand Down

0 comments on commit ace9c78

Please sign in to comment.