merged changes from Baptiste

Closes #156
This commit is contained in:
Maccesch 2024-08-22 17:47:06 +01:00
parent f44ef05466
commit eb73bff3cd
162 changed files with 941 additions and 714 deletions

View file

@ -40,7 +40,12 @@ wasm-bindgen-futures = "0.4"
web-sys = { version = "=0.3.70", optional = true } web-sys = { version = "=0.3.70", optional = true }
[dev-dependencies] [dev-dependencies]
codee = { version = "0.1", features = ["json_serde", "msgpack_serde", "base64", "prost"] } codee = { version = "0.1", features = [
"json_serde",
"msgpack_serde",
"base64",
"prost",
] }
getrandom = { version = "0.2", features = ["js"] } getrandom = { version = "0.2", features = ["js"] }
leptos_meta = { git = "https://github.com/leptos-rs/leptos" } leptos_meta = { git = "https://github.com/leptos-rs/leptos" }
rand = "0.8" rand = "0.8"

View file

@ -7,13 +7,11 @@ members = [
"signal_throttled", "signal_throttled",
"sync_signal", "sync_signal",
"use_abs", "use_abs",
"use_active_element",
"use_and", "use_and",
"use_breakpoints", "use_breakpoints",
"use_broadcast_channel", "use_broadcast_channel",
"use_ceil", "use_ceil",
"use_clipboard", "use_clipboard",
"use_color_mode",
"use_cookie", "use_cookie",
"use_css_var", "use_css_var",
"use_cycle_list", "use_cycle_list",
@ -23,7 +21,6 @@ members = [
"use_display_media", "use_display_media",
"use_document_visibility", "use_document_visibility",
"use_draggable", "use_draggable",
"use_drop_zone",
"use_element_bounding", "use_element_bounding",
"use_element_hover", "use_element_hover",
"use_element_size", "use_element_size",
@ -61,18 +58,28 @@ members = [
"use_user_media", "use_user_media",
"use_web_notification", "use_web_notification",
"use_websocket", "use_websocket",
"use_webtransport",
"use_window_focus", "use_window_focus",
"use_window_scroll", "use_window_scroll",
"watch_debounced", "watch_debounced",
"watch_pausable", "watch_pausable",
"watch_throttled", "watch_throttled",
# "use_active_element",
# "use_color_mode",
# "use_drop_zone",
# "use_webtransport",
] ]
exclude = [ exclude = ["ssr", "use_webtransport_with_server"]
"ssr",
"use_webtransport_with_server", [workspace.dependencies]
] leptos = { git = "https://github.com/leptos-rs/leptos" }
console_error_panic_hook = "0.1"
console_log = "1"
log = "0.4"
leptos-use = { path = "..", features = ["docs"] }
web-sys = "0.3"
wasm-bindgen = "0.2"
wasm-bindgen-test = "0.3.0"
[package] [package]
name = "leptos-use-examples" name = "leptos-use-examples"

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["on_click_outside", "docs"] } leptos-use = { workspace = true, features = ["on_click_outside", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -6,7 +6,7 @@ use leptos_use::on_click_outside;
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let (show_modal, set_show_modal) = signal(false); let (show_modal, set_show_modal) = signal(false);
let modal_ref = create_node_ref::<Div>(); let modal_ref = NodeRef::<Div>::new();
let _ = on_click_outside(modal_ref, move |_| set_show_modal.set(false)); let _ = on_click_outside(modal_ref, move |_| set_show_modal.set(false));
@ -78,7 +78,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["signal_debounced", "docs"] } leptos-use = { workspace = true, features = ["signal_debounced", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -26,7 +26,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["signal_throttled", "docs"] } leptos-use = { workspace = true, features = ["signal_throttled", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -26,7 +26,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -12,10 +12,14 @@ codee = "0.1"
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
cfg-if = "1" cfg-if = "1"
leptos = { version = "0.6", features = ["nightly"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = ["nightly"] }
leptos_axum = { version = "0.6", optional = true } leptos_axum = { git = "https://github.com/leptos-rs/leptos", optional = true }
leptos_meta = { version = "0.6", features = ["nightly"] } leptos_meta = { git = "https://github.com/leptos-rs/leptos", features = [
leptos_router = { version = "0.6", features = ["nightly"] } "nightly",
] }
leptos_router = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
] }
log = "0.4" log = "0.4"
simple_logger = "4" simple_logger = "4"
tokio = { version = "1", features = ["full"], optional = true } tokio = { version = "1", features = ["full"], optional = true }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["sync_signal", "docs"] } leptos-use = { workspace = true, features = ["sync_signal", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -19,7 +19,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -27,7 +27,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["use_active_element", "docs"] }
web-sys = { version = "0.3", features = ["HtmlElement", "DomStringMap"] } web-sys = { version = "0.3", features = ["HtmlElement", "DomStringMap"] }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -33,7 +33,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -11,7 +11,7 @@ fn Demo() -> impl IntoView {
view! { view! {
<div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4"> <div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4">
<label for_="smooth-scrolling-option" class="text-right opacity-75"> <label for="smooth-scrolling-option" class="text-right opacity-75">
Input <code>A</code> Input <code>A</code>
</label> </label>
<span> <span>
@ -22,7 +22,7 @@ fn Demo() -> impl IntoView {
type="checkbox" type="checkbox"
/> />
</span> </span>
<label for_="smooth-scrolling-option" class="text-right opacity-75"> <label for="smooth-scrolling-option" class="text-right opacity-75">
Input <code>B</code> Input <code>B</code>
</label> </label>
<span> <span>
@ -43,7 +43,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_breakpoints", "docs"] } leptos-use = { workspace = true, features = ["use_breakpoints", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -207,7 +207,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
codee = "0.1" codee = "0.1"
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
@ -13,5 +16,5 @@ leptos-use = { path = "../..", features = ["use_broadcast_channel", "docs"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -57,7 +57,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -27,7 +27,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_clipboard", "docs"] } leptos-use = { workspace = true, features = ["use_clipboard", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -46,7 +46,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_color_mode", "docs"] } leptos-use = { workspace = true, features = ["use_color_mode", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -40,7 +40,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
codee = "0.1" codee = "0.1"
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
@ -15,5 +18,5 @@ getrandom = { version = "0.2", features = ["js"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -1,7 +1,7 @@
use codee::string::FromToStringCodec;
use leptos::prelude::*; use leptos::prelude::*;
use leptos_use::docs::demo_or_body; use leptos_use::docs::demo_or_body;
use leptos_use::use_cookie; use leptos_use::use_cookie;
use codee::string::FromToStringCodec;
use rand::prelude::*; use rand::prelude::*;
#[component] #[component]
@ -40,7 +40,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_css_var", "docs"] } leptos-use = { workspace = true, features = ["use_color_mode", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_css_var_with_options, UseCssVarOptions};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let (color, set_color) = let (color, set_color) =
use_css_var_with_options("--color", UseCssVarOptions::default().target(el)); use_css_var_with_options("--color", UseCssVarOptions::default().target(el));
let switch_color = move |_| { let switch_color = move |_| {
@ -16,7 +16,7 @@ fn Demo() -> impl IntoView {
} }
}; };
let elv = create_node_ref::<Div>(); let elv = NodeRef::<Div>::new();
let (key, set_key) = signal("--color".to_string()); let (key, set_key) = signal("--color".to_string());
let (color_val, _) = use_css_var_with_options(key, UseCssVarOptions::default().target(elv)); let (color_val, _) = use_css_var_with_options(key, UseCssVarOptions::default().target(elv));
let change_var = move |_| { let change_var = move |_| {
@ -58,7 +58,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_cycle_list", "docs"] } leptos-use = { workspace = true, features = ["use_cycle_list", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -23,7 +23,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_debounce_fn", "docs"] } leptos-use = { workspace = true, features = ["use_debounce_fn", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -31,7 +31,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_device_orientation", "docs"] } leptos-use = { workspace = true, features = ["use_device_orientation", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -29,7 +29,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_device_pixel_ratio", "docs"] } leptos-use = { workspace = true, features = ["use_device_pixel_ratio", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -18,7 +18,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_display_media", "docs"] } leptos-use = { workspace = true, features = ["use_display_media", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -4,7 +4,7 @@ use leptos_use::{use_display_media, UseDisplayMediaReturn};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let video_ref = create_node_ref::<leptos::html::Video>(); let video_ref = NodeRef::<leptos::html::Video>::new();
let UseDisplayMediaReturn { let UseDisplayMediaReturn {
stream, stream,
@ -13,17 +13,25 @@ fn Demo() -> impl IntoView {
.. ..
} = use_display_media(); } = use_display_media();
create_effect(move |_| { Effect::new(move |_| {
match stream.get() { match stream.get() {
Some(Ok(s)) => { Some(Ok(s)) => {
video_ref.get().map(|v| v.set_src_object(Some(&s))); video_ref.with(|v| {
if let Some(v) = v {
v.set_src_object(Some(&s));
}
});
return; return;
} }
Some(Err(e)) => logging::error!("Failed to get media stream: {:?}", e), Some(Err(e)) => leptos::logging::error!("Failed to get media stream: {:?}", e),
None => logging::log!("No stream yet"), None => leptos::logging::log!("No stream yet"),
} }
video_ref.get().map(|v| v.set_src_object(None)); video_ref.with(|v| {
if let Some(v) = v {
v.set_src_object(None);
}
});
}); });
view! { view! {
@ -51,7 +59,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_document_visibility", "docs"] } leptos-use = { workspace = true, features = ["use_document_visibility", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -9,7 +9,7 @@ fn Demo() -> impl IntoView {
let (message, set_message) = signal(start_message); let (message, set_message) = signal(start_message);
let visibility = use_document_visibility(); let visibility = use_document_visibility();
let _ = watch( Effect::watch(
visibility, visibility,
move |cur, prev, _| { move |cur, prev, _| {
if let Some(prev) = prev { if let Some(prev) = prev {
@ -37,7 +37,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_draggable", "docs"] } leptos-use = { workspace = true, features = ["use_draggable", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -6,7 +6,7 @@ use leptos_use::{use_draggable_with_options, use_window, UseDraggableOptions, Us
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let inner_width = use_window() let inner_width = use_window()
.as_ref() .as_ref()
@ -40,7 +40,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_drop_zone", "docs"] } leptos-use = { workspace = true, features = ["use_drop_zone", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -7,7 +7,7 @@ use leptos_use::{use_drop_zone_with_options, UseDropZoneOptions, UseDropZoneRetu
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let (dropped, set_dropped) = signal(false); let (dropped, set_dropped) = signal(false);
let drop_zone_el = create_node_ref::<Div>(); let drop_zone_el = NodeRef::<Div>::new();
let UseDropZoneReturn { let UseDropZoneReturn {
is_over_drop_zone, is_over_drop_zone,
@ -50,7 +50,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_element_bounding", "docs"] } leptos-use = { workspace = true, features = ["use_element_bounding", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_element_bounding, UseElementBoundingReturn};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Textarea>(); let el = NodeRef::<Textarea>::new();
let UseElementBoundingReturn { let UseElementBoundingReturn {
width, width,
@ -48,7 +48,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_element_hover", "docs"] } leptos-use = { workspace = true, features = ["use_element_hover", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_element_hover_with_options, UseElementHoverOptions};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Button>(); let el = NodeRef::<Button>::new();
let is_hovered = use_element_hover_with_options( let is_hovered = use_element_hover_with_options(
el, el,
@ -25,7 +25,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_element_size", "docs"] } leptos-use = { workspace = true, features = ["use_element_size", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_element_size, UseElementSizeReturn};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Textarea>(); let el = NodeRef::<Textarea>::new();
let UseElementSizeReturn { width, height } = use_element_size(el); let UseElementSizeReturn { width, height } = use_element_size(el);
@ -26,7 +26,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_element_visibility", "docs"] } leptos-use = { workspace = true, features = ["use_element_visibility", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::use_element_visibility;
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let is_visible = use_element_visibility(el); let is_visible = use_element_visibility(el);
@ -32,7 +32,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["use_event_listener"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -10,7 +10,7 @@ fn Demo() -> impl IntoView {
log!("window keydown: '{}'", evt.key()); log!("window keydown: '{}'", evt.key());
}); });
let element = create_node_ref::<A>(); let element = NodeRef::<A>::new();
let _ = use_event_listener(element, click, |evt| { let _ = use_event_listener(element, click, |evt| {
log!( log!(
@ -61,7 +61,7 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to_body(|| { leptos::mount::mount_to_body(|| {
view! { <Demo/> } view! { <Demo/> }
}) })
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_favicon", "docs"] } leptos-use = { workspace = true, features = ["use_favicon", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -105,7 +105,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -27,7 +27,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_geolocation", "docs"] } leptos-use = { workspace = true, features = ["use_geolocation", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -53,7 +53,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_idle", "docs"] } leptos-use = { workspace = true, features = ["use_idle", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -26,7 +26,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_infinite_scroll", "docs"] } leptos-use = { workspace = true, features = ["use_infinite_scroll", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_infinite_scroll_with_options, UseInfiniteScrollOptions};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let (data, set_data) = signal(vec![1, 2, 3, 4, 5, 6]); let (data, set_data) = signal(vec![1, 2, 3, 4, 5, 6]);
@ -34,7 +34,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_intersection_observer", "docs"] } leptos-use = { workspace = true, features = ["use_intersection_observer", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -8,8 +8,8 @@ use leptos_use::{
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let root = create_node_ref::<Div>(); let root = NodeRef::<Div>::new();
let target = create_node_ref::<Div>(); let target = NodeRef::<Div>::new();
let (is_visible, set_visible) = signal(false); let (is_visible, set_visible) = signal(false);
let UseIntersectionObserverReturn { let UseIntersectionObserverReturn {
@ -95,7 +95,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_interval", "docs"] } leptos-use = { workspace = true, features = ["use_interval", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -17,7 +17,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["use_interval_fn", "docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -66,7 +66,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_intl_number_format", "docs"] } leptos-use = { workspace = true, features = ["use_intl_number_format", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -50,7 +50,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -13,5 +16,5 @@ unic-langid = { version = "0.9", features = ["macros"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -1,4 +1,4 @@
use leptos::*; use leptos::prelude::*;
use leptos_use::docs::demo_or_body; use leptos_use::docs::demo_or_body;
use leptos_use::use_locale; use leptos_use::use_locale;
use unic_langid::langid_slice; use unic_langid::langid_slice;
@ -16,7 +16,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_locales", "docs"] } leptos-use = { workspace = true, features = ["use_locales", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -1,4 +1,4 @@
use leptos::*; use leptos::prelude::*;
use leptos_use::docs::demo_or_body; use leptos_use::docs::demo_or_body;
use leptos_use::use_locales; use leptos_use::use_locales;
@ -15,7 +15,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_media_query", "docs"] } leptos-use = { workspace = true, features = ["use_media_query", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -17,7 +17,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_mouse", "docs"] } leptos-use = { workspace = true, features = ["use_mouse", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -23,7 +23,7 @@ impl UseMouseEventExtractor for Extractor {
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let mouse_default = use_mouse(); let mouse_default = use_mouse();
@ -74,7 +74,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_mouse_in_element", "docs"] } leptos-use = { workspace = true, features = ["use_mouse_in_element", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::{use_mouse_in_element, UseMouseInElementReturn};
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let UseMouseInElementReturn { let UseMouseInElementReturn {
x, x,
@ -47,7 +47,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_mutation_observer", "docs"] } leptos-use = { workspace = true, features = ["use_mutation_observer", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -6,7 +6,7 @@ use std::time::Duration;
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Div>(); let el = NodeRef::<Div>::new();
let (messages, set_messages) = signal(vec![]); let (messages, set_messages) = signal(vec![]);
let (class_name, set_class_name) = signal(String::new()); let (class_name, set_class_name) = signal(String::new());
let (style, set_style) = signal(String::new()); let (style, set_style) = signal(String::new());
@ -58,7 +58,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -9,7 +9,7 @@ fn Demo() -> impl IntoView {
view! { view! {
<div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4"> <div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4">
<label for_="smooth-scrolling-option" class="text-right opacity-75"> <label for="smooth-scrolling-option" class="text-right opacity-75">
Input <code>A</code> Input <code>A</code>
</label> </label>
<span> <span>
@ -30,7 +30,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -11,7 +11,7 @@ fn Demo() -> impl IntoView {
view! { view! {
<div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4"> <div class="px-6 py-4 rounded grid grid-cols-[100px_auto] gap-4">
<label for_="smooth-scrolling-option" class="text-right opacity-75"> <label for="smooth-scrolling-option" class="text-right opacity-75">
Input <code>A</code> Input <code>A</code>
</label> </label>
<span> <span>
@ -22,7 +22,7 @@ fn Demo() -> impl IntoView {
type="checkbox" type="checkbox"
/> />
</span> </span>
<label for_="smooth-scrolling-option" class="text-right opacity-75"> <label for="smooth-scrolling-option" class="text-right opacity-75">
Input <code>B</code> Input <code>B</code>
</label> </label>
<span> <span>
@ -43,7 +43,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_permission", "docs"] } leptos-use = { workspace = true, features = ["use_permission", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -22,6 +22,7 @@ fn Demo() -> impl IntoView {
view! { view! {
<pre> <pre>
<>
"accelerometer: " {move || accelerometer().to_string()} "accelerometer: " {move || accelerometer().to_string()}
"\naccessibility_events: " {move || accessibility_events().to_string()} "\naccessibility_events: " {move || accessibility_events().to_string()}
"\nambient_light_sensor: " {move || ambient_light_sensor().to_string()} "\nambient_light_sensor: " {move || ambient_light_sensor().to_string()}
@ -30,6 +31,7 @@ fn Demo() -> impl IntoView {
"\nclipboard_read: " {move || clipboard_read().to_string()} "\nclipboard_read: " {move || clipboard_read().to_string()}
"\nclipboard_write: " {move || clipboard_write().to_string()} "\nclipboard_write: " {move || clipboard_write().to_string()}
"\ngyroscope: " {move || gyroscope().to_string()} "\ngyroscope: " {move || gyroscope().to_string()}
</><>
"\nmagnetometer: " {move || magnetometer().to_string()} "\nmagnetometer: " {move || magnetometer().to_string()}
"\nmicrophone: " {move || microphone().to_string()} "\nmicrophone: " {move || microphone().to_string()}
"\nnotifications: " {move || notifications().to_string()} "\nnotifications: " {move || notifications().to_string()}
@ -37,6 +39,7 @@ fn Demo() -> impl IntoView {
"\npersistent_storage: " {move || persistent_storage().to_string()} "\npersistent_storage: " {move || persistent_storage().to_string()}
"\npush: " {move || push().to_string()} "\npush: " {move || push().to_string()}
"\nspeaker: " {move || speaker().to_string()} "\nspeaker: " {move || speaker().to_string()}
</>
</pre> </pre>
} }
} }
@ -45,7 +48,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_prefers_reduced_motion", "docs"] } leptos-use = { workspace = true, features = ["use_prefers_reduced_motion", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -1,4 +1,4 @@
use leptos::*; use leptos::prelude::*;
use leptos_use::docs::{demo_or_body, BooleanDisplay}; use leptos_use::docs::{demo_or_body, BooleanDisplay};
use leptos_use::use_prefers_reduced_motion; use leptos_use::use_prefers_reduced_motion;
@ -23,7 +23,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_raf_fn", "docs"] } leptos-use = { workspace = true, features = ["use_raf_fn", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -29,7 +29,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,13 +4,13 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { workspace = true, features = ["nightly", "csr"] }
console_error_panic_hook = "0.1" console_error_panic_hook = { workspace = true }
console_log = "1" console_log = { workspace = true }
log = "0.4" log = { workspace = true }
leptos-use = { path = "../..", features = ["use_resize_observer", "docs"] } leptos-use = { workspace = true, features = ["use_resize_observer", "docs"] }
web-sys = "0.3" web-sys = { workspace = true }
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

View file

@ -5,7 +5,7 @@ use leptos_use::use_resize_observer;
#[component] #[component]
fn Demo() -> impl IntoView { fn Demo() -> impl IntoView {
let el = create_node_ref::<Textarea>(); let el = NodeRef::<Textarea>::new();
let (text, set_text) = signal("".to_string()); let (text, set_text) = signal("".to_string());
use_resize_observer(el, move |entries, _| { use_resize_observer(el, move |entries, _| {
@ -32,7 +32,9 @@ fn main() {
_ = console_log::init_with_level(log::Level::Debug); _ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once(); console_error_panic_hook::set_once();
mount_to(demo_or_body(), || { let unmount_handle = leptos::mount::mount_to(demo_or_body(), || {
view! { <Demo/> } view! { <Demo/> }
}) });
unmount_handle.forget();
} }

View file

@ -4,7 +4,10 @@ version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
leptos = { version = "0.6", features = ["nightly", "csr"] } leptos = { git = "https://github.com/leptos-rs/leptos", features = [
"nightly",
"csr",
] }
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
console_log = "1" console_log = "1"
log = "0.4" log = "0.4"
@ -12,5 +15,5 @@ leptos-use = { path = "../..", features = ["docs", "math"] }
web-sys = "0.3" web-sys = "0.3"
[dev-dependencies] [dev-dependencies]
wasm-bindgen = "0.2" wasm-bindgen = { workspace = true }
wasm-bindgen-test = "0.3.0" wasm-bindgen-test = { workspace = true }

Some files were not shown because too many files have changed in this diff Show more