From 32d38704480d2b5bd92b106dfbe194caac3901a3 Mon Sep 17 00:00:00 2001 From: matt Date: Wed, 22 Dec 2021 01:37:38 -0700 Subject: [PATCH] documentation touch up --- Cargo.lock | 28 ++++++++++++++++++++++++---- yew-interop/Cargo.toml | 3 ++- yew-interop/src/lib.rs | 7 +++++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a6d4c8..9bff773 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,21 +561,27 @@ dependencies = [ [[package]] name = "yew-interop" -version = "0.1.0" +version = "0.1.1" dependencies = [ "gloo-events", "gloo-utils", "wasm-bindgen", "web-sys", "yew", - "yew-interop-core", - "yew-interop-macro", + "yew-interop-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-interop-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-interop-core" version = "0.1.0" +[[package]] +name = "yew-interop-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dbb150eb7be7538552293c0095108899c1cecb3dd0f99d6ed74e91e612a04e" + [[package]] name = "yew-interop-macro" version = "0.1.0" @@ -585,7 +591,21 @@ dependencies = [ "proc-macro2", "quote", "syn", - "yew-interop-core", + "yew-interop-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "yew-interop-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f383978e86c12cfb8e5a5ccf1ff594eaa2c52a062f6fdc36902975126e5d24" +dependencies = [ + "convert_case", + "itertools", + "proc-macro2", + "quote", + "syn", + "yew-interop-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/yew-interop/Cargo.toml b/yew-interop/Cargo.toml index 1588bca..b9d4735 100644 --- a/yew-interop/Cargo.toml +++ b/yew-interop/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "yew-interop" -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "MIT" description = "use javascript and css asynchrously in yew" homepage = "https://github.com/Madoshakalaka/yew-interop" repository = "https://github.com/Madoshakalaka/yew-interop" +readme = "../README.md" keywords = ["yew", "interop", "js", "css", "npm"] categories = ["api-bindings", "asynchronous", "wasm", "web-programming"] diff --git a/yew-interop/src/lib.rs b/yew-interop/src/lib.rs index 343392f..5a5df29 100644 --- a/yew-interop/src/lib.rs +++ b/yew-interop/src/lib.rs @@ -8,7 +8,7 @@ pub use yew_interop_core::{Link, LinkType}; pub use yew_interop_macro::declare_resources; /// Run javascript after a component is rendered. -/// Note the script will be re-run for every re-render. +/// Note the script will run for every render. /// If you want to conditionally run the script, see [`use_conditional_script_effect`] pub fn use_script_effect(src: &'static str) { use_effect(move || { @@ -36,7 +36,10 @@ fn insert_script(src: &str, document: &Document) { } } -/// The script will be re-run when `should_rerun` returns true. +/// Run a script conditionally. +/// +/// `should_run` receives `d` as the argument and returns a `bool`. +/// The script will only run when `should_rerun` returns true. pub fn use_conditional_script_effect(src: &'static str, should_run: Filter, d: Dep) where Dep: PartialEq + 'static,