我试图了解如何将可观察数组与 Mobx 一起使用。
我很难弄清楚为什么会这样:
let entities = observable([]);
entities[0] = "foo";
autorun(() =>{
console.log(entities);
});
写道:
[$mobx: Object]
0: (...)
1: (...)
2: (...)
3: (...)
4: (...)
5: (...)
6: (...)
7: (...)
8: (...)
9: (...)
10: (...)
11: (...)
12: (...)
13: (...)
14: (...)
15: (...)
16: (...)
17: (...)
...
999: (...)
而不是经典数组?