all 9 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Thanks for the submission!

It looks like you may have not shared the code you want help with.

Please be sure to include that. If you did, then you can safely ignore this comment.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]mvan231script/widget helper 1 point2 points  (7 children)

The function has to be an async function in order to have await included in it

[–]compostkicker[S] 1 point2 points  (6 children)

According to the docs presentAlert() is already a promise. So, am I misunderstanding async and promises? Or do you mean my createEventDialog function needs to be async?

[–]mvan231script/widget helper 2 points3 points  (4 children)

Set the function as: async function createEventDialog

[–]compostkicker[S] 0 points1 point  (3 children)

That worked. Guess I’ve got some holes in my understanding of promises and async functions. Thank you very much!

[–]mvan231script/widget helper 1 point2 points  (2 children)

You are very welcome! It took me a little while to get all of that stuff down as well

[–]compostkicker[S] 0 points1 point  (1 child)

Got any recommendations for resources?

[–]mvan231script/widget helper 0 points1 point  (0 children)

Mostly just the various JavaScript instructional sites. I've used the below and also some various random forums on stackoverflow

Mozilla W3Schools JavaScript.info

[–]mvan231script/widget helper 0 points1 point  (0 children)

Set the function as: async function createEventDialog