diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-26 16:00:59 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-26 16:00:59 +0100 |
| commit | 8dd8f96b24710dc4f2d29065928244a40a432379 (patch) | |
| tree | 192fcdbef2373a983673e929835bff64ad8edb48 /src/zilch/app/event.js | |
| parent | feeedb0bf31314b182e7bbc135182f6e0bc859b2 (diff) | |
zilch: update App structure and split-up document and wasm logic
Diffstat (limited to 'src/zilch/app/event.js')
| -rw-r--r-- | src/zilch/app/event.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/zilch/app/event.js b/src/zilch/app/event.js new file mode 100644 index 0000000..c55637c --- /dev/null +++ b/src/zilch/app/event.js @@ -0,0 +1,14 @@ +async function wasm_handle_event(target, name, event, pass_event) { + await wasm_ready; + + const component = target.getRootNode().host; + + if (pass_event) { + const id = ObjectStore.generateFreeId(); + ObjectStore.registerObject(id, event); + wasm.exports[name](component[ZsPtr], id); + ObjectStore.free(event); + } else { + wasm.exports[name](component[ZsPtr]); + } +} |