/// Reset the viewer's `ViewerConfig` to the default.
///
/// # Arguments
/// - `all` Whether to clear `expressions` also.
Reset the viewer's `ViewerConfig` to the default.
Reset the viewer ' s ` ViewerConfig ` to the default .
pub fn js_reset(&self, reset_expressions: JsValue) -> js_sys::Promise {
        let (sender, receiver) = channel::<()>();
        let root = self.root.clone();
        let all = reset_expressions.as_bool().unwrap_or_default();
        promisify_ignore_view_delete(async move {
            root.borrow()
                .as_ref()
                .ok_or("Already deleted!")?
                .send_message(Msg::Reset(all, Some(sender)));
            receiver.await.map_err(|_| JsValue::from("Cancelled"))?;
            Ok(JsValue::UNDEFINED)
        })
    }
pub fn js_reset ( & self , reset_expressions : JsValue ) -> js_sys :: Promise { let ( sender , receiver ) = channel :: < ( ) > ( ) ; let root = self . root . clone ( ) ; let all = reset_expressions . as_bool ( ) . unwrap_or_default ( ) ; promisify_ignore_view_delete ( async move { root . borrow ( ) . as_ref ( ) . ok_or ( " " ) ? . send_message ( Msg :: Reset ( all , Some ( sender ) ) ) ; receiver . await . map_err ( | _ | JsValue :: from ( " " ) ) ? ; Ok ( JsValue :: UNDEFINED ) } ) }
Reset the viewer's `ViewerConfig` to the default.
Reset the viewer ' s ` ViewerConfig ` to the default .
&self
reset_expressions
JsValue
all
Whether to clear `expressions` also.
Whether to clear ` expressions ` also .