如何设置嵌套对象?

时间:2016-07-07 21:43:54

标签: react-redux immutable.js

我正在尝试设置redux状态,但不是整个对象树,而只是一个子树。

对象图 -

Parent
 |----Header
 |----Summary
         |-----List of objects

我正在使用以下代码 -

return state.setIn([Parent, 'Summary'], summary)

它设置摘要对象,但对象列表为空。我做错了什么?

1 个答案:

答案 0 :(得分:0)

你可以这样试试:

public class HelloWorld {
  public static void main(String[] args) {
    final int n = 50;
    int i = 0;
    while (i <= n) {
      if (i % 10 == 0) {
        System.out.println(i);
      }
      i++;
    }
  }
}