meteor-rxjs
meteor-rxjs copied to clipboard
client find, server added->ready->changed does not trigger query update
maybe I am misunderstanding how find should with with RXJS in Meteor.
if I have this on the client
Models
find(type): Observable<any[]> {
return this.Models.find({});
}
constructor(){
MeteorObservable.subscribe('testCollection').subscribe();
this.Models = new MongoObservable.Collection<any>('testPublisher', {idGeneration: 'MONGO'});
}
and this on the server
Meteor.publish('testPublisher', function () {
this.added('testCollection', 'testId', {doc: []});
this.ready();
this.changed('testCollection', 'testId', {doc: [{test:'test'}]});
})
shouldn't the 'this.changed' trigger the find results to return the updated model in the find query? However, I am only ever receiving the initial model from 'this.added'.
Thanks
cant even seem to get the changed doc even if I call,
let docs = new Subject();
let sub = this.Models.find({})
.observe({
added(document, atIndex, before){
docs.next(document);
},
changed(newDocument, oldDocument) {
docs.next(newDocument);
}
});