2016-04-05 50 views
2

無法在我的路線中使用Observable。路由器不會將pathValue發送到客戶端。我究竟做錯了什麼?Falcor Router Observable

{ 
    route: 'starshipsById[{integers:starshipIds}][{keys:props}]', 
    get: (pathSet) => Observable.from(pathSet.starshipIds) 
     .flatMap(starshipId => 
      Observable.fromPromise(r.table('starshipsById').get(starshipId).run(c)) 
      .flatMap(starship => Observable.from(pathSet.props).map(key => { 
       const pathValue = !starship ? 
       { 
       path: ['starshipsById', starship.id], 
       value: null, 
       } : { 
       path: ['starshipsById', starship.id, key], 
       value: starship[key] || null 
       }; 
       return pathValue; 
      }) 
     )) 
    } 

回答

0

主要問題是使用錯誤的Observable節點包。我用「rx」替換了「rxjs」包,現在工作正常。