[question] Why do I need to be an arrow function when calling a javascript function asynchronously? #10957
Unanswered
nabezokodaikon
asked this question in
Q&A
Replies: 2 comments 14 replies
-
I don't know the answer for sure but I'm guessing its because a function requires a "this" while the arrow function does not. Perhaps you could make it work but you have to find the right rust signature? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I notice you are bundling. How does the output of Also what version of Deno are you using? |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why do I need to be an arrow function when calling a javascript function asynchronously?
If you define it in function normally, you will get an error that it is not defined.
Cargo.toml
lib.rs
timer.ts
build.sh
#!/bin/bash cargo build --target wasm32-unknown-unknown --release wasm-bindgen target/wasm32-unknown-unknown/release/wasm_timer.wasm --target web --out-dir ./public/pkg deno bundle public/ts/timer.ts public/js/timer.js
Repository
Beta Was this translation helpful? Give feedback.
All reactions