在嵌套数组中从循环中反应redux更新状态

时间:2016-02-10 11:12:03

标签: javascript reactjs redux

我的状态如下:

while ( hidden.length ) {
  hidden[ 0 ].className = '';
}

我有一些返回值,如:

"dynamic"

在这里,我想以同步方式更新每个值调用dispatch:

当我调用"strict"时,数据是循环中的每个值。我想要的结果如下:

{
  "mappings": {
    "el_tipo": {
      "dynamic": "strict",
      "properties": {
        "name": {
          "type": "string" 
        },
        "age": {
          "type": "integer" 
        },
        "read": {
          "type": "integer" 
        }
      }
    }
  }
}

我被困在这里:

data: Object
  value: []

我可以得到一些帮助吗?

1 个答案:

答案 0 :(得分:0)

func navigationController(navigationController: UINavigationController, willShowViewController viewController: UIViewController, animated: Bool) 
  {
    viewController.navigationItem.title = "video" // Change title
    imagePicker.navigationBar.tintColor = .whiteColor() //Text Color
    imagePicker.navigationBar.titleTextAttributes = [
        NSForegroundColorAttributeName : UIColor.whiteColor()
    ]

  }

我假设var person = { type: 'personal', info: yourDataHere }; return Object.assign({}, state, {data: Object.assign({}, data, { value: state.data.value.concat(person) })});

yourDataHere