Stream: ComponentizeJS

Topic: Promise and async/await support


view this post on Zulip Damian Reeves (Jun 12 2024 at 20:40):

Does ComponentizeJS support promises and/or async/await?

view this post on Zulip Joel Dice (Jun 12 2024 at 20:45):

I think that's what this issue is about: https://github.com/bytecodealliance/ComponentizeJS/issues/112 @Guy Bedford could say for sure.

When implementing sync component model functions as async exports in JS (functions returning a promise), we should integrate with the event loop by: Detecting if a promise is returned in the bindge...

view this post on Zulip Damian Reeves (Jun 12 2024 at 20:50):

I guess that answers, whether exported promises are supported, but I wonder what about if a promise is used internally? Like I'm wondering if I can get around needing promises by using a notification resource or by having an import that is called .

view this post on Zulip Till Schneidereit (Jun 13 2024 at 18:00):

it does, yes: it has an internal event loop that resolves promises as needed


Last updated: Nov 22 2024 at 16:03 UTC