pub fn try_local_storage() -> Result<web_sys::Storage, JsValue> {
    web_sys::window()
        .ok_or_else(|| JsValue::from_str("Could not obtain window"))
        .and_then(|window| {
            window
                .local_storage()
                .and_then(|x| x.ok_or_else(|| JsValue::from_str("Could not obtain local storage")))
        })
}
/// Gracefully try to obtain the Web local storage API.
Gracefully try to obtain the Web local storage API.
Gracefully try to obtain the Web local storage API .
pub fn try_local_storage() -> Result<web_sys::Storage, JsValue> {
    web_sys::window()
        .ok_or_else(|| JsValue::from_str("Could not obtain window"))
        .and_then(|window| {
            window
                .local_storage()
                .and_then(|x| x.ok_or_else(|| JsValue::from_str("Could not obtain local storage")))
        })
}
pub fn try_local_storage ( ) -> Result < web_sys :: Storage , JsValue > { web_sys :: window ( ) . ok_or_else ( | | JsValue :: from_str ( " " ) ) . and_then ( | window | { window . local_storage ( ) . and_then ( | x | x . ok_or_else ( | | JsValue :: from_str ( " " ) ) ) } ) }
Gracefully try to obtain the Web local storage API.
Gracefully try to obtain the Web local storage API .