Skip to content

Commit 2669572

Browse files
committed
Docs updated to 2024-03-02
1 parent b9cf9ec commit 2669572

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

docs/user-guide/builtins.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,20 @@ response = await fetch("https://example.com", method="POST", body="HELLO").text(
193193
bug). However, you could use a pass-through proxy service to get around
194194
this limitation (i.e. the proxy service makes the call on your behalf).
195195

196+
### `pyscript.ffi.to_js`
197+
198+
A utility function to convert Python references into their JavaScript
199+
equivalents. For example, a Python dictionary is converted into a JavaScript
200+
object literal (rather than a JavaScript `Map`).
201+
202+
### `pyscript.ffi.create_proxy`
203+
204+
A utility function explicitly for when a callback function is added via an
205+
event listener. It ensures the function still exists beyond the assignment of
206+
the function to an event. Should you not `create_proxy` around the callback
207+
function, it will be immediately garbage collected after being bound to the
208+
event.
209+
196210
## Main-thread only features
197211

198212
### `pyscript.PyWorker`

docs/user-guide/dom.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ equivalent values: `["hello", 1, 2, 3]`.
6868
instantiation very differently. By explicitly calling the JavaScript
6969
class's `new` method PyScript both signals and honours this difference.
7070

71+
Should you require lower level API access to FFI features, you can find such
72+
builtin functions under the `pyscript.ffi` namespace in both Pyodide and
73+
MicroPython. The available functions are described in our section on
74+
[builtin helpers](../builtins).
7175

7276
## PyDom
7377

0 commit comments

Comments
 (0)