mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
implement observeChangesAsync on the client
This commit is contained in:
@@ -373,6 +373,13 @@ export default class Cursor {
|
||||
return handle;
|
||||
}
|
||||
|
||||
observeChangesAsync(options) {
|
||||
return new Promise((resolve) => {
|
||||
const handle = this.observeChanges(options);
|
||||
handle.isReadyPromise.then(() => resolve(handle));
|
||||
});
|
||||
}
|
||||
|
||||
// XXX Maybe we need a version of observe that just calls a callback if
|
||||
// anything changed.
|
||||
_depend(changers, _allow_unordered) {
|
||||
|
||||
@@ -966,8 +966,7 @@ Cursor.prototype.observeChanges = function (callbacks, options = {}) {
|
||||
};
|
||||
|
||||
Cursor.prototype.observeChangesAsync = async function (callbacks, options = {}) {
|
||||
var self = this;
|
||||
return self.observeChanges(callbacks, options);
|
||||
return this.observeChanges(callbacks, options);
|
||||
};
|
||||
|
||||
MongoConnection.prototype._createSynchronousCursor = function(
|
||||
|
||||
Reference in New Issue
Block a user