Hi there,
is it possible to use promises inside events handlers using async await?
I thought it was possiible, but now i’m facing some strange behaviour and i’m not so sure.
This is a snippet of code:
let b = new BABYLON.GUI.Button.CreateSimpleButton("generalPurpose","Conferma e continua\ncon altri articoli");
b.onPointerDownObservable.add((**async** function(){
this.currentAlert.dispose();
this.currentAlert = null;
if(generalPurpFunction!==null){
// esegue l'eventuale callback
let qta = 0;
let um = "-";
if(inputBox!==null){
qta = parseFloat(inputBox.text);
um = data._arum1;
}
**await** generalPurpFunction(qta,um);
}
}).bind(this));
generalPurpFunction is my asyncronous function.
In DOM it could be working, does Babylon works the same?