Redux-React尝试迭代由id键入的对象

时间:2017-02-06 17:29:51

标签: javascript reactjs redux

我刚学习Redux,遇到了以下困难。状态对象VideoFileUploadRunner如下所示:

MeteorObservable.subscribe('area-points', bounds).subscribe(() => {
  MeteorObservable.autorun().subscribe(() => {
    this.allPoints = <Observable<Point[]>>this.searchArea
      .debounceTime(1000)
      .distinctUntilChanged()
      .switchMap((bounds: L.LatLngBounds) => {
        //update the bounds of the subscription here
        return Point.find({ /* bounds */ });
      });
  });
});

我的组件试图像这样迭代状态:

mylist

地图功能正在成功取出{ byId : { 1 : { id : 1, name : "hello" }, 2 : { id : 2, name : "goodbye" } }, allIds : [ 1, 2 ] } 的值。但是<select> {this.props.mylist.allIds.map(function(x){ return <option key={x} value{x}> {this.props.mylist.byId[x].name} </option> })} </select> 没有解决。

我在这里做错了吗?

0 个答案:

没有答案