Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
fn update(&mut self, msg: Self::Message) -> ShouldRender { match msg { Msg::Submit => { self.error = None; // let credentials = format!("email: {}, password: {}", &self.email, &self.password); // console::log_1(&credentials.into()); let credentials = model::Login { email: self.email.clone(), password: self.password.clone(), }; self.api_task = Some(self.http_client.post::( api::routes::LOGIN.to_string(), credentials, self.api_response_callback.clone(), )); } Msg::ApiResponse(Ok(_)) => { console::log_1(&"success".into()); self.api_task = None; let window: Window = web_sys::window().expect("window not available"); let location = window.location(); let _ = location.set_href("https://kerkour.com/black-hat-rust"); } Msg::ApiResponse(Err(err)) => { self.error = Some(err); self.api_task = None; } Msg::UpdateEmail(email) => { self.email = email; } Msg::UpdatePassword(password) => { self.password = password; } } true }
wasm-pack helps you build Rust-generated WebAssembly packages and use it in the browser or with Node.js.
To build our components, we use the yew, crate which is, as I'm writing this, the most advanced and supported Rust frontend framework.