【问题标题】:Falcor Router ObservableFalcor 路由器 Observable
【发布时间】:2016-07-25 11:05:29
【问题描述】:

在我的路线中使用 Observable 时遇到问题。路由器没有将 pathValue 发送给客户端。我做错了什么?

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

【问题讨论】:

    标签: router observable falcor


    【解决方案1】:

    主要问题是使用了错误的 Observable 节点包。我用“rx”替换了“rxjs”包,现在可以正常使用了。

    【讨论】:

      猜你喜欢
      • 2016-02-12
      • 2015-12-08
      • 2016-05-17
      • 2015-12-12
      • 2015-11-13
      • 2015-12-31
      • 2018-01-27
      • 2015-11-18
      • 2017-03-02
      相关资源
      最近更新 更多