Closed rahul007-bit closed 3 months ago
You can wrap js_sys::Function
in newtype wrapper and implement NativeCallbackHandler
for it.
struct JsCallback(js_sys::Function);
impl NativeCallbackHandler for JsCallback {
...
}
std_opts.add_native(NativeCallback::new(
vec!["param1".to_owned(), "param2".to_owned()],
JsCallback(js_function)
))
I am working to create javascript bindings with jrsonnet using wasm-bindgen. I am stuck at native callback since I can't use wasm-bindgen's
js_sys::Function
inadd_native
is there any way, I can use the callback received from wasm-bindgen in jrsonnet?