We could use JS function/promises to show alters after the APIs are consumed. Following is a code snippet that you could use in JS Objects:
export default {
myFun1: () => {
{{Api1.run(() => showAlert("Success"), () => showAlert("Failure"))}}
},
myFun2: async () => {
//use async-await or promises
}
}
To know more about promises and callbacks read our documentation here: