use anyhow::{anyhow, Result};
use web_sys::{Document, Window};
pub fn set_panic_hook() {
#[cfg(feature = "console_error_panic_hook")]
console_error_panic_hook::set_once();
}
pub fn window() -> Result<Window> {
web_sys::window().ok_or_else(|| anyhow!("No Window Found"))
}
pub fn document() -> Result<Document> {
window()?
.document()
.ok_or_else(|| anyhow!("No Document Found"))
}