Urigo / meteor-rxjs

Exposing Mongo Cursor as RxJS Observable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zone.js 0.7.4 - View not updating

muehle28 opened this issue · comments

The code inside the callback of a MongoObservable subscription is not updating the view. Its working when I put zone.run(). Before the update I used v0.6 without problems.

I have the same problem (but doesn't seem related to zone.js version, things are still broken with 0.7.8)

Furthermore a map operator is not invoked. E.g.

const t = Task.find({}).map((tasks)=>{console.log(1); return tasks}).zone();

t.subscribe((tasks)=>{
 console.log('tasks: ', tasks);
})

the map operator is SKIPPED (no console.log) if I use zone()

I'm wondering why there aren't more people tripping into this issue.

Found a workaround. Moved the .zone() to the MeteorObservable.subscribe. E.g.

MeteorObservable.subscribe('AllTasks').zone().subscribe(() => {
     const t = Task.find({}).map((tasks)=>{console.log(1); return tasks});

     t.subscribe((tasks)=>{
       console.log('tasks: ', tasks);
    })
}