Skip to content

Commit

Permalink
Publish v0.2.0 with use_memo patch
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz committed Jun 6, 2024
1 parent 62855a6 commit d83941c
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 43 deletions.
82 changes: 51 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[package]
name = "dioxus-spring"
description = "Animation library for Dioxus"
version = "0.2.0-alpha.2"
version = "0.2.0"
edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
async-channel = "1.9.0"
dioxus = { git = "https://github.com/DioxusLabs/dioxus" }
dioxus-web = { git = "https://github.com/DioxusLabs/dioxus" }
dioxus-signals = { git = "https://github.com/DioxusLabs/dioxus" }
dioxus = "0.5.1"
dioxus-web = "0.5.1"
dioxus-signals = "0.5.1"
futures = "0.3.28"
interpolation = "0.3.0"
js-sys = "0.3.64"
log = "0.4.20"
dioxus-logger = "0.4.1"
wasm-bindgen = "0.2.87"
web-sys = "0.3.64"
dioxus-use-mounted = { git = "https://github.com/matthunz/dioxus-use-mounted" }
dioxus-use-mounted = "0.2.0"
slotmap = "1.0.6"

[dev-dependencies]
dioxus-resize-observer = { git = "https://github.com/dioxus-community/dioxus-resize-observer", rev = "1a16141a63dbb17230a3dacc97d949861aa2125f" }
dioxus-resize-observer = "0.2.0"
2 changes: 1 addition & 1 deletion examples/use_spring_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn app() -> Element {
spring_ref.animate(1., Duration::from_secs(1));
});

use_effect(move || {
use_memo(move || {
log::info!("{}", signal());
});

Expand Down
2 changes: 1 addition & 1 deletion examples/use_spring_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn app() -> Element {
value_spring.animate(1., Duration::from_secs(1));
});

use_effect(move || {
use_memo(move || {
log::info!("{}", value());
});

Expand Down
4 changes: 2 additions & 2 deletions src/use_animated.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dioxus::hooks::use_effect;
use dioxus::hooks::use_memo;
use dioxus_signals::{Readable, Signal};
use dioxus_use_mounted::UseMounted;

Expand All @@ -10,7 +10,7 @@ pub fn use_animated<V>(
) where
V: Clone,
{
use_effect(move || {
use_memo(move || {
let value = value_ref.read();
set_style(mounted, &make_style(value.clone()));
});
Expand Down
4 changes: 2 additions & 2 deletions src/use_spring.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::use_spring_signal;
use dioxus::{hooks::use_reactive, prelude::use_effect};
use dioxus::{hooks::use_reactive, prelude::use_memo};
use dioxus_signals::Signal;
use interpolation::Lerp;
use std::time::Duration;
Expand All @@ -13,7 +13,7 @@ where
{
let (signal, spring_ref) = use_spring_signal(value.clone());

use_effect(use_reactive((&value,), move |(to,)| {
use_memo(use_reactive((&value,), move |(to,)| {
spring_ref.animate(to, duration);
}));

Expand Down

0 comments on commit d83941c

Please sign in to comment.