Plumb Responses from WASM to JS in the page

This commit is contained in:
Keavon Chambers
2021-04-10 02:48:33 -07:00
parent 934286b1bd
commit 958d351505
8 changed files with 104 additions and 112 deletions
+4 -3
View File
@@ -21,14 +21,15 @@ pub fn init() {
}
fn handle_response(response: Response) {
let response_type = response.to_string();
match response {
Response::UpdateCanvas { document } => updateCanvas(document),
Response::UpdateCanvas { document } => handleResponse(response_type, document),
}
}
#[wasm_bindgen(module = "/../src/wasm-callback-processor.js")]
#[wasm_bindgen(module = "/../src/response-handler.ts")]
extern "C" {
fn updateCanvas(svg: String);
fn handleResponse(responseType: String, responseData: String);
}
#[wasm_bindgen]