Split the crate in 3, introduce JS frontend
This commit is contained in:
32
app/src/app.rs
Normal file
32
app/src/app.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use lldap_model::*;
|
||||
use yew::prelude::*;
|
||||
|
||||
pub struct App {}
|
||||
|
||||
pub enum Msg {
|
||||
BindRequest(BindRequest),
|
||||
ListUsersRequest(ListUsersRequest),
|
||||
}
|
||||
|
||||
impl Component for App {
|
||||
type Message = Msg;
|
||||
type Properties = ();
|
||||
|
||||
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
|
||||
App {}
|
||||
}
|
||||
|
||||
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
|
||||
true
|
||||
}
|
||||
|
||||
fn change(&mut self, _: Self::Properties) -> ShouldRender {
|
||||
false
|
||||
}
|
||||
|
||||
fn view(&self) -> Html {
|
||||
html! {
|
||||
<p>{ "Hello world!" }</p>
|
||||
}
|
||||
}
|
||||
}
|
||||
10
app/src/lib.rs
Normal file
10
app/src/lib.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
mod app;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn run_app() -> Result<(), JsValue> {
|
||||
yew::start_app::<app::App>();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user