I have two methods seen below, the first method is a wired call:
@wired (firstMethodCall, {param1: 'test'})
wiredResult(result){
console.log('1');
this.secondMethodCall();
console.log('5');
}
secondMethodCall(){
console.log('2');
imperativeApexCall({param1: 'test'})
.then(result => {
console.log('3');
});
console.log('4');
}
When the wired call runs, The console logs in the following order:
1
2
4
5
3
I want it to run sequentially to print:
1
2
3
4
5
How can I make sure the imperative apex call has fully completed executing before the line "console.log('5')" in the wired call runs?