响应式监听
MobX
术语介绍
var numbers = observable([1, 2, 3]);
var sum = computed(() => numbers.reduce((a, b) => a + b, 0));
var disposer = autorun(() => console.log(sum.get()));
// 打印 '6'
numbers.push(4);
// 打印 '10'
disposer();
numbers.push(5);
// 此时并不会打印出任何对象