// Send a network event to the network thread
Send a network event to the network thread
Send a network event to the network thread
pub fn dispatch(&mut self, action: IoEvent) {
    // `is_loading` will be set to false again after the async action has finished in network.rs
    self.is_loading = true;
    if let Some(io_tx) = &self.io_tx {
      if let Err(e) = io_tx.send(action) {
        self.is_loading = false;
        println!("Error from dispatch {}", e);
        self.handle_error(anyhow!(e));
      };
    }
  }
pub fn dispatch ( & mut self , action : IoEvent ) { // `is_loading` will be set to false again after the async action has finished in network.rs self . is_loading = true ; if let Some ( io_tx ) = & self . io_tx { if let Err ( e ) = io_tx . send ( action ) { self . is_loading = false ; println ! ( " " e ) ; self . handle_error ( anyhow ! ( e ) ) ; } ; } }
Send a network event to the network thread
Send a network event to the network thread
&mut self
action
IoEvent