mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-01-23 00:59:22 -05:00
Minor change
This commit is contained in:
parent
e84cbe5e84
commit
b420cc742a
1 changed files with 1 additions and 2 deletions
|
@ -42,11 +42,10 @@ pub fn use_device_orientation() -> UseDeviceOrientationReturn {
|
||||||
let gamma = || None;
|
let gamma = || None;
|
||||||
} else {
|
} else {
|
||||||
use crate::{use_event_listener_with_options, UseEventListenerOptions};
|
use crate::{use_event_listener_with_options, UseEventListenerOptions};
|
||||||
use js_sys::Reflect;
|
|
||||||
use leptos::ev::deviceorientation;
|
use leptos::ev::deviceorientation;
|
||||||
use wasm_bindgen::JsValue;
|
use wasm_bindgen::JsValue;
|
||||||
|
|
||||||
let is_supported = Signal::derive(|| Reflect::has(
|
let is_supported = Signal::derive(|| js_sys::Reflect::has(
|
||||||
&window(),
|
&window(),
|
||||||
&JsValue::from_str("DeviceOrientationEvent"),
|
&JsValue::from_str("DeviceOrientationEvent"),
|
||||||
).unwrap_or(false));
|
).unwrap_or(false));
|
||||||
|
|
Loading…
Add table
Reference in a new issue