wip: book documentation

This commit is contained in:
Jonathan Kelley committed 2021-10-16 17:04:28 -04:00
1 parent 7dedad4c26
commit 16dbf4a6f8
87 files changed
+997 -319

No files matched your search

View File
Whitespace-only changes.
+1 -1
View File
@@ -8,7 +8,7 @@ use gloo_timers::future::TimeoutFuture;
#[tokio::main]
async fn main() {
dioxus::desktop::launch(App, |c| c).await;
dioxus::desktop::launch(App, |c| c);
}
pub static App: FC<()> = |cx, _| {
+1 -1
View File
@@ -7,7 +7,7 @@ use dioxus::events::*;
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch(APP, |cfg| cfg).unwrap();
dioxus::desktop::launch(APP, |cfg| cfg);
}
const APP: FC<()> = |cx, _| {
+1 -1
View File
@@ -3,7 +3,7 @@ use fxhash::FxBuildHasher;
use std::rc::Rc;
fn main() {
dioxus::desktop::launch(App, |c| c).unwrap();
dioxus::desktop::launch(App, |c| c);
}
// We use a special immutable hashmap to make hashmap operations efficient
+1 -1
View File
@@ -16,7 +16,7 @@ fn main() {
let vdom = VirtualDom::new(App);
let content = ssr::render_vdom(&vdom, |f| f.pre_render(true));
dioxus::desktop::launch(App, |c| c.with_prerendered(content)).unwrap();
dioxus::desktop::launch(App, |c| c.with_prerendered(content));
}
static App: FC<()> = |cx, props| {
+1 -2
View File
@@ -28,8 +28,7 @@ fn main() {
.with_resizable(false)
.with_inner_size(LogicalSize::new(320.0, 530.0))
})
})
.expect("failed to launch dioxus app");
});
}
static App: FC<()> = |cx, props| {
+1 -1
View File
@@ -21,7 +21,7 @@ pub struct TodoItem {
pub contents: String,
}
const STYLE: &str = include_str!("./_examples/todomvc/style.css");
const STYLE: &str = include_str!("./assets/todomvc.css");
const App: FC<()> = |cx, props| {
let draft = use_state(cx, || "".to_string());
let todos = use_state(cx, || HashMap::<u32, Rc<TodoItem>>::new());