Simplified version of my store...
export class DataStore {
api;
@observable prop1;
@observable prop2;
@observable data1;
@observable data2;
constructor(api) {
this.api = api
reaction(
() => this.prop1,
(id, reaction) => {
this.loadData1();
}
);
reaction(
() => this.prop2,
(id, reaction) => {
this.loadData2();
}
);
}
@action
async loadData1() {
let results = await this.api.getData1(
this.prop1
);
runInAction(() => {
this.data1 = results.data;
});
}
async loadData2() {
let results = await this.api.getData2(
this.prop2
);
runInAction(() => {
this.data2 = results.data;
});
}
}
the prop1 reaction triggers first without issue. Once the prop2 reaction triggers I get the following message in the console.
Warning: a promise was created in a handler but was not returned from it
I've debugged myself in circles and can't seem to track down the cause of the warning. Any help would be greatly appreciated!