Closed str4d closed 4 years ago
In the stream today, I ran into the issue that types with lifetimes cannot be returned from Rust to JavaScript, so instead we boxed the values and returned the pointers as u32s (eww).
u32
It literally just occurred to me that, once we have the pointer as an integer, we can just wrap that in a newtype and then #[wasm_bindgen] to have a JavaScript typed object 🤩
#[wasm_bindgen]
In the stream today, I ran into the issue that types with lifetimes cannot be returned from Rust to JavaScript, so instead we boxed the values and returned the pointers as
u32
s (eww).It literally just occurred to me that, once we have the pointer as an integer, we can just wrap that in a newtype and then
#[wasm_bindgen]
to have a JavaScript typed object 🤩