Allowing for an async function event to take place within webr::eval_js()
#378
Labels
feature
New feature or request
webr::eval_js()
#378
I'm trying to write an async function to potentially be included in the
{webr}
support package. The function seeks to check if data associated with a URL can be retrieved and used in the webR session. The determination is built on the criteria of the URL:https
protocol, andThe problem arises when I'm seeking to run the underlying JS function that uses
await fetch()
to retrieve theHEAD
of the response (not body contents to avoid duplicate downloading). This portion is given by:For all intents and purposes, this works nicely in web dev tools:
When I move the function over to use
webr::eval_js()
, I end up receiving:If I remove the
async
andawait
portions of the above code, then I end up getting a promise being sent back that will be undefined and, thus, return a clean status code of0
.Is there a good way forward to having promises get resolved? Or should I host a web form that says "check your data URL here"?
The text was updated successfully, but these errors were encountered: