mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
chore: rustfmt
This commit is contained in:
parent
4999313f32
commit
79e87d3ad0
4 changed files with 34 additions and 22 deletions
|
@ -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::*;
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue