fixed docs and tests for unstable web apis

This commit is contained in:
Maccesch 2023-06-05 03:06:26 +01:00
parent 64f790c955
commit fbf5c5a0d3
4 changed files with 12 additions and 7 deletions

View file

@ -1,5 +1,3 @@
[build] [build]
rustflags = ["--cfg=web_sys_unstable_apis"] rustflags = ["--cfg=web_sys_unstable_apis"]
rustdocflags = ["--cfg=web_sys_unstable_apis"]
[host]
rustflags = ["--cfg=web_sys_unstable_apis"]

View file

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.1.8
- Fixed documentation and doc tests running for functions behind `#[cfg(web_sys_unstable_apis)]`
## 0.1.7 ## 0.1.7
#### New Function #### New Function

View file

@ -1,6 +1,6 @@
[package] [package]
name = "leptos-use" name = "leptos-use"
version = "0.1.7" version = "0.1.8"
edition = "2021" edition = "2021"
authors = ["Marc-Stefan Cassola"] authors = ["Marc-Stefan Cassola"]
categories = ["gui", "web-programming"] categories = ["gui", "web-programming"]
@ -46,3 +46,4 @@ math = ["num"]
[package.metadata."docs.rs"] [package.metadata."docs.rs"]
all-features = true all-features = true
rustdoc-args = ["--cfg=web_sys_unstable_apis"]

View file

@ -27,7 +27,7 @@ use wasm_bindgen::prelude::*;
/// # #[component] /// # #[component]
/// # fn Demo(cx: Scope) -> impl IntoView { /// # fn Demo(cx: Scope) -> impl IntoView {
/// let el = create_node_ref(cx); /// let el = create_node_ref(cx);
/// let (text, set_text) = create_signal(cx, ""); /// let (text, set_text) = create_signal(cx, "".to_string());
/// ///
/// use_resize_observer( /// use_resize_observer(
/// cx, /// cx,
@ -37,8 +37,10 @@ use wasm_bindgen::prelude::*;
/// set_text(format!("width: {}\nheight: {}", rect.width(), rect.height())); /// set_text(format!("width: {}\nheight: {}", rect.width(), rect.height()));
/// }, /// },
/// ); /// );
/// # ///
/// # view! { cx, } /// view! { cx,
/// <div node_ref=el>{ text }</div>
/// }
/// # } /// # }
/// ``` /// ```
/// ## See also /// ## See also