diff --git a/.idea/icon.svg b/.idea/icon.svg index fb9d78d..09f8e86 100644 --- a/.idea/icon.svg +++ b/.idea/icon.svg @@ -2,6 +2,17 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> + + style="fill-rule:nonzero;"/> \ No newline at end of file diff --git a/.idea/leptos-use.iml b/.idea/leptos-use.iml index 9a57ee7..e4cba54 100644 --- a/.idea/leptos-use.iml +++ b/.idea/leptos-use.iml @@ -48,6 +48,10 @@ + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index c925260..b21db9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Braking Changes πŸ›  +- Leptos version is now 0.5 +- No `cx: Scope` params are supported/needed anymore because of the changes in Leptos. + Please check the release notes of Leptos 0.5 for how to upgrade. - `watch` is now deprecated in favor of `leptos::watch`. `watch_with_options` will continue to exist. diff --git a/Cargo.toml b/Cargo.toml index 213d0ae..6ba2f57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leptos-use" -version = "0.6.0" +version = "0.7.0-alpha" edition = "2021" authors = ["Marc-Stefan Cassola"] categories = ["gui", "web-programming"] @@ -13,7 +13,7 @@ repository = "https://github.com/Synphonyte/leptos-use" homepage = "https://leptos-use.rs" [dependencies] -leptos = "0.4" +leptos = "0.5.0-alpha" wasm-bindgen = "0.2" js-sys = "0.3" default-struct-builder = "0.4" @@ -80,5 +80,3 @@ all-features = true rustdoc-args = ["--cfg=web_sys_unstable_apis"] rustc-args = ["--cfg=web_sys_unstable_apis"] -[dev-dependencies] -leptos = "0.4" diff --git a/README.md b/README.md index a70e763..75c44b4 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ use leptos::*; use leptos_use::{use_mouse, UseMouseReturn}; #[component] -fn Demo(cx: Scope) -> impl IntoView { - let UseMouseReturn { x, y, .. } = use_mouse(cx); +fn Demo() -> impl IntoView { + let UseMouseReturn { x, y, .. } = use_mouse(); view! { cx, {x} " x " {y} @@ -89,3 +89,4 @@ To scaffold a new function quickly you can run `template/createfn.sh`. It requir |---------------|---------------------------| | <= 0.3 | 0.3 | | 0.4, 0.5, 0.6 | 0.4 | +| main | 0.5.0-alpha | diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index 0542b5d..5f40d76 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -62,6 +62,11 @@ - [watch_with_options](watch/watch_with_options.md) - [whenever](watch/whenever.md) +# Reactivity + +- [signal_debounced](reactivity/signal_debounced.md) +- [signal_throttled](reactivity/signal_throttled.md) + # Utilities - [is_err](utilities/is_err.md) diff --git a/docs/book/src/get_started.md b/docs/book/src/get_started.md index 46cc788..9a40e34 100644 --- a/docs/book/src/get_started.md +++ b/docs/book/src/get_started.md @@ -19,8 +19,8 @@ use leptos::*; use leptos_use::{use_mouse, UseMouseReturn}; #[component] -fn Demo(cx: Scope) -> impl IntoView { - let UseMouseReturn { x, y, .. } = use_mouse(cx); +fn Demo() -> impl IntoView { + let UseMouseReturn { x, y, .. } = use_mouse(); view! { cx, {x} " x " {y} diff --git a/docs/book/src/server_side_rendering.md b/docs/book/src/server_side_rendering.md index ace770e..8f16416 100644 --- a/docs/book/src/server_side_rendering.md +++ b/docs/book/src/server_side_rendering.md @@ -41,7 +41,7 @@ create_effect( cx, move |_| { // window() doesn't work on the server - use_event_listener(cx, window(), "resize", move |_| { + use_event_listener(window(), "resize", move |_| { // ... }) }, diff --git a/examples/Cargo.toml b/examples/Cargo.toml index e238422..4c3dec2 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -3,6 +3,8 @@ resolver = "2" members = [ "on_click_outside", + "signal_debounced", + "signal_throttled", "use_abs", "use_active_element", "use_breakpoints", diff --git a/examples/on_click_outside/Cargo.toml b/examples/on_click_outside/Cargo.toml index 6a27995..a055bb2 100644 --- a/examples/on_click_outside/Cargo.toml +++ b/examples/on_click_outside/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -leptos = { version = "0.4", features = ["nightly", "csr"] } +leptos = { version = "0.5.0-alpha", features = ["nightly", "csr"] } console_error_panic_hook = "0.1" console_log = "1" log = "0.4" diff --git a/examples/on_click_outside/src/main.rs b/examples/on_click_outside/src/main.rs index 93ee27a..6571e51 100644 --- a/examples/on_click_outside/src/main.rs +++ b/examples/on_click_outside/src/main.rs @@ -4,16 +4,15 @@ use leptos_use::docs::demo_or_body; use leptos_use::on_click_outside; #[component] -fn Demo(cx: Scope) -> impl IntoView { - let (show_modal, set_show_modal) = create_signal(cx, false); - let modal_ref = create_node_ref::
(cx); +fn Demo() -> impl IntoView { + let (show_modal, set_show_modal) = create_signal(false); + let modal_ref = create_node_ref::
(); - let _ = on_click_outside(cx, modal_ref, move |_| set_show_modal.set(false)); + let _ = on_click_outside(modal_ref, move |_| set_show_modal.set(false)); - view! { cx, - + view! { - +