Mashiane Expert Licensed User Longtime User Oct 25, 2020 #1 Ola How do I use async and await with BANano, for example. B4X: async function handleButtonClick() { const actionSheet = await actionSheetController.create({ header: 'Albums', buttons: [ { text: 'Delete', role: 'destructive' }, { text: 'Share' }, { text: 'Play' }, { text: 'Favorite' }, { text: 'Cancel', role: 'cancel' } ] }); await actionSheet.present(); } Thank you.
Ola How do I use async and await with BANano, for example. B4X: async function handleButtonClick() { const actionSheet = await actionSheetController.create({ header: 'Albums', buttons: [ { text: 'Delete', role: 'destructive' }, { text: 'Share' }, { text: 'Play' }, { text: 'Favorite' }, { text: 'Cancel', role: 'cancel' } ] }); await actionSheet.present(); } Thank you.
Mashiane Expert Licensed User Longtime User Dec 5, 2020 #2 Finally managed to work this out: Define a promise and use BANano.Await(?) B4X: Dim p as bananopromise = BANano.DoWhatEver BANano.Await(p) p.Then(Response) log(Response) p.Else(Error) log(Error) p.End Upvote 0
Finally managed to work this out: Define a promise and use BANano.Await(?) B4X: Dim p as bananopromise = BANano.DoWhatEver BANano.Await(p) p.Then(Response) log(Response) p.Else(Error) log(Error) p.End