I am using Ionic2 with Meteor. I observe
a Cursor
, for when it gets added to or updated.
public messages: Mongo.Cursor<Message>;
this.messages.observe({
added: (message) => this.addMessageToLocal(message),
changed: (message) => this.updateMessageToLocal(message)
});
In my case, the added
event gets triggered before the changed
event. However, they run asynchronously. I would like the event that is triggered first (added
) to finish before the next event (changed
) starts.
Is this possible?
Thank you