Function leptos_use::use_supported

source ·
pub fn use_supported(callback: impl Fn() -> bool + 'static) -> Signal<bool>
Expand description

SSR compatibe is_supported

§Usage

let is_supported = use_supported(
    || js!("getBattery" in &window().navigator())
);

if is_supported.get() {
    // do something
}