Docs说,使用@action可以带来优化的好处。这是否意味着该方法开始与React setState()类似?
因此,例如有onChange处理程序,该处理程序从输入获取值并将其设置为存储。下面的代码能按预期工作吗?
handleChange = (e) => {
const { target: { value } } = e;
const newValue = Number(value);
// this method is marked as @action and just set primitive value in store
this.props.store.setValue(newValue);
// produce some actions with this.props.store.value(new value expected)
...
}