stdweb icon indicating copy to clipboard operation
stdweb copied to clipboard

Example of js_export use

Open David-OConnor opened this issue 6 years ago • 1 comments

I think the documentation on the main page needs a full example of js_export use that includes how to import it, or one of the examples in the examples folder should include this.

When I try #[macro_use]:

error: attribute procedural macros cannot be imported with #[macro_use]
...
help: instead, import the procedural macro like any other item: use stdweb_internal_macros::js_export;

If I try to import stdweb::stdweb_internal_macros::js_export: module stdweb_internal_macros is private

edit: It appears that the correct way to import is: use stdweb::js_export;

I recommend adding that line to the example in the docs.

David-OConnor avatar Jun 29 '18 04:06 David-OConnor

Yes, we already have an example crate for that which is linked to in the README. (:

https://github.com/koute/stdweb/tree/master/examples/hasher

koute avatar Jun 29 '18 22:06 koute