Re:Iodide: An experimental Mozilla tool for data exploration...
by alexkavon on Wednesday March 13, 2019 @11:14PM
(#19386257)
Also MDN has a fantastic Promise article with examples about wrapping a function with a promise.[0]
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re:Iodide: An experimental Mozilla tool for data exploration...
by JonathonW on Wednesday March 13, 2019 @11:16PM
(#19386267)
It's a little unclear, but I think he wants to integrate Python (Pyodide) coroutines into the JS event loop-- so async/await of Python code works seamlessly in the browser, and you can await Python code from within JS (and vice versa).
Any JS Promise is awaitable from JS; JS async/await is (more or less) syntactic sugar on top of promises.
Re:Iodide: An experimental Mozilla tool for data exploration...
by bayesian_horse on Wednesday March 13, 2019 @11:49PM
(#19386391)
Sorry, I meant to use "await" in Python to await Javascript Promises.
For example, running `await Promise.resolve(3)` in Chrome's js console prints `3`.