chore: rustfmt

This commit is contained in:
Maccesch 2023-06-24 01:17:23 +01:00
parent 4999313f32
commit 79e87d3ad0
4 changed files with 34 additions and 22 deletions

View file

@ -21,11 +21,11 @@ pub use use_element_size::*;
pub use use_resize_observer::*;
mod on_click_outside;
mod use_cycle_list;
mod use_color_mode;
mod use_active_element;
mod use_breakpoints;
mod use_color_mode;
mod use_css_var;
mod use_cycle_list;
mod use_debounce_fn;
mod use_element_hover;
mod use_element_visibility;
@ -49,11 +49,11 @@ mod watch_throttled;
mod whenever;
pub use on_click_outside::*;
pub use use_cycle_list::*;
pub use use_color_mode::*;
pub use use_active_element::*;
pub use use_breakpoints::*;
pub use use_color_mode::*;
pub use use_css_var::*;
pub use use_cycle_list::*;
pub use use_debounce_fn::*;
pub use use_element_hover::*;
pub use use_element_visibility::*;

View file

@ -152,13 +152,17 @@ where
);
}
let _ = watch(cx, move || variable.get(), move |val, _, _| {
if let Some(el) = el_signal.get() {
let el = el.into().unchecked_into::<web_sys::HtmlElement>();
let style = el.style();
let _ = style.set_property(&prop.get_untracked(), val);
}
});
let _ = watch(
cx,
move || variable.get(),
move |val, _, _| {
if let Some(el) = el_signal.get() {
let el = el.into().unchecked_into::<web_sys::HtmlElement>();
let style = el.style();
let _ = style.set_property(&prop.get_untracked(), val);
}
},
);
(variable, set_variable)
}

View file

@ -90,13 +90,17 @@ pub fn use_favicon_with_options(
}
};
let _ = watch(cx, move || favicon.get(), move |new_icon, prev_icon, _| {
if Some(new_icon) != prev_icon {
if let Some(new_icon) = new_icon {
apply_icon(new_icon);
let _ = watch(
cx,
move || favicon.get(),
move |new_icon, prev_icon, _| {
if Some(new_icon) != prev_icon {
if let Some(new_icon) = new_icon {
apply_icon(new_icon);
}
}
}
});
},
);
(favicon, set_favicon)
}

View file

@ -110,11 +110,15 @@ where
if matches!(interval, MaybeSignal::Dynamic(_)) {
let resume = resume.clone();
let stop_watch = watch(cx, move || interval.get(), move |_, _, _| {
if is_active.get() {
resume();
}
});
let stop_watch = watch(
cx,
move || interval.get(),
move |_, _, _| {
if is_active.get() {
resume();
}
},
);
on_cleanup(cx, stop_watch);
}