You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use async/await within Worklets?
I'm trying to make calls to asynchronous functions outside of the function tagged with the worklet keyword? As a simple example, is it possible to use the Expo FileSystem async functions like copyFileAsync() from within a worklet?
When tried, I get errors like this:
TypeError: Cannot assign to read only property 'message' of object 'SyntaxError: unknown: Unexpected reserved word 'yield'.
The text was updated successfully, but these errors were encountered:
You can't do asynchronous things within worklets since they don't run the event loop as far as I know.
However, I didn't expect that async/await syntax is not supported in worklets. The error message indicates that worklets don't support generator syntax which is emitted as a transpilation result of async/await.
That makes sense but I was hoping it would just execute synchronously. In this scenario I don't need it to be asynchronous since it's in another thread, I just need to call something which relies on that syntax.
Is it possible to use async/await within Worklets?
I'm trying to make calls to asynchronous functions outside of the function tagged with the worklet keyword? As a simple example, is it possible to use the Expo FileSystem async functions like copyFileAsync() from within a worklet?
When tried, I get errors like this:
The text was updated successfully, but these errors were encountered: