Please advise if it is correct to use mobx actions (https://mobx.js.org/refguide/action.html) to fetch remote api or do similar stuff:
@action readSomething() {
this.observableLoading = true;
executeRead(
this.param1,
mappedData => {
this.observableData = mappedData;
this.observableLoading = false;
},
() => {
console.log('error occurred');
},
);
}
If the approach does not violate idea behind mobx stores and store's action, how to report fetch errors? Introduce dedicated observable for errors pipeline?