Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use wasm_bindgen instead of handwritten js bindings #1

Open
lcnr opened this issue Dec 25, 2018 · 0 comments
Open

use wasm_bindgen instead of handwritten js bindings #1

lcnr opened this issue Dec 25, 2018 · 0 comments

Comments

@lcnr
Copy link

lcnr commented Dec 25, 2018

I rewrote your crate to use wasm_bindgen and web_sys instead of manually written java script functions. i.e

use wasm_bindgen::prelude::*;

fn print(buf: &str) -> io::Result<()> {
    web_sys::console::info_1(&JsValue::from(buf));
    Ok(())
}

fn eprint(buf: &str) -> io::Result<()> {
    web_sys::console::warn_1(&JsValue::from(buf));
    Ok(())
}

If you want, I can polish my implementation and open a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant