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
Copy file name to clipboardExpand all lines: README.md
+28-12Lines changed: 28 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ What's New on 1.1
13
13
14
14
- New Async/Await or Promise API
15
15
- New Python classes to expose JS API and Objects like DOM API, XHR, Node.JS require, and etc
16
+
- New Python promise class to wait promises with emscripten_sleep, using Emterpreter
16
17
17
18
18
19
Running with Node.js
@@ -60,10 +61,31 @@ import mp_js from 'micropython';
60
61
})();
61
62
```
62
63
63
-
API
64
+
65
+
Python API
66
+
---
67
+
68
+
The following functions and classes is used to interact with Javascript. Load this API with ```mp_js.init_python(stack_size)```
69
+
70
+
```python
71
+
JS(variable_name)
72
+
```
73
+
Check for variable on Javascript's global and return the corresponding types, functions and Javascript objects instantiate JSFunction and JSObject class. Promise instantiate JSPromise class.
74
+
75
+
```python
76
+
wait(promise)
77
+
```
78
+
Wait for a promise to be resolved on Javascript, and then returns the value. Uses emscripten_sleep. Also available as JSPromise class function:
0 commit comments