npm packaging

This commit is contained in:
CoolElectronics 2024-01-15 14:37:55 -05:00
parent 6e3f968f9c
commit 656eb67bfb
No known key found for this signature in database
GPG key ID: F63593D168636C50
9 changed files with 82 additions and 24 deletions

View file

@ -26,6 +26,7 @@ pub struct EpxWebSocket {
#[wasm_bindgen]
impl EpxWebSocket {
#[wasm_bindgen(constructor)]
/// DO NOT CALL THIS!!!!!!!!!!!!!!!!!!!
pub fn new() -> Result<EpxWebSocket, JsError> {
Err(jerr!("Use EpoxyClient.connect_ws() instead."))
}
@ -156,7 +157,8 @@ impl EpxWebSocket {
let (tx, rx) = oneshot::channel();
self.msg_sender.send(EpxMsg::SendText(payload, tx)).await?;
Ok(rx.await??)
}.await;
}
.await;
if let Err(ret) = ret {
let _ = onerr.call1(&JsValue::null(), &jval!(ret.clone()));
Err(ret)