diff --git a/examples/Cargo.toml b/examples/Cargo.toml index ae26de4..3bd37f5 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -28,7 +28,6 @@ members = [ "use_element_size", "use_element_visibility", "use_event_listener", - "use_event_source", "use_favicon", "use_floor", "use_geolocation", diff --git a/src/use_element_size.rs b/src/use_element_size.rs index aa82d24..8b178bc 100644 --- a/src/use_element_size.rs +++ b/src/use_element_size.rs @@ -2,7 +2,6 @@ use crate::core::{ElementMaybeSignal, Size}; use cfg_if::cfg_if; use default_struct_builder::DefaultBuilder; use leptos::*; -use wasm_bindgen::prelude::wasm_bindgen; cfg_if! { if #[cfg(not(feature = "ssr"))] { use crate::{use_resize_observer_with_options, UseResizeObserverOptions}; @@ -137,10 +136,18 @@ where }; set_width.set(format_box_size.iter().fold(0.0, |acc, v| { - acc + v.as_ref().clone().unchecked_into::().inline_size() + acc + v + .as_ref() + .clone() + .unchecked_into::() + .inline_size() })); set_height.set(format_box_size.iter().fold(0.0, |acc, v| { - acc + v.as_ref().clone().unchecked_into::().block_size() + acc + v + .as_ref() + .clone() + .unchecked_into::() + .block_size() })) } else { // fallback @@ -192,14 +199,3 @@ pub struct UseElementSizeReturn { /// The height of the element. pub height: Signal, } - -#[wasm_bindgen] -extern "C" { - type BoxSize; - - #[wasm_bindgen(method, getter = blockSize)] - fn block_size(this: &BoxSize) -> f64; - - #[wasm_bindgen(method, getter = inlineSize)] - fn inline_size(this: &BoxSize) -> f64; -}