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;
})
))
}