From 69dd699b999f7672897ba10312a0716ceef1bf27 Mon Sep 17 00:00:00 2001 From: Reinis Mazeiks Date: Thu, 30 Jun 2022 22:58:34 +0300 Subject: [PATCH] Remove outdated example; Add note on performance benchmark --- examples/README.md | 8 ++++++-- examples/order.rs | 28 ---------------------------- 2 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 examples/order.rs diff --git a/examples/README.md b/examples/README.md index 2c07885bc..732b19ba8 100644 --- a/examples/README.md +++ b/examples/README.md @@ -74,8 +74,6 @@ cargo run --example hello_world [tasks](./tasks.rs) - Continuously run future -[order](./order.rs) - ### SVG [svg_basic](./svg_basic.rs) @@ -86,6 +84,12 @@ cargo run --example hello_world [framework_benchmark](./framework_benchmark.rs) - Renders a huge list +> Note: The benchmark should be run in release mode: +> +>```shell +> cargo run --example framework_benchmark --release +>``` + [heavy_compute](./heavy_compute.rs) - How to deal with expensive operations ## Server-side rendering diff --git a/examples/order.rs b/examples/order.rs deleted file mode 100644 index fee6f9184..000000000 --- a/examples/order.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![allow(non_snake_case)] - -//! This example proves that instantly resolving futures don't cause issues - -use dioxus::prelude::*; - -fn main() { - dioxus::desktop::launch(App); -} - -fn App(cx: Scope) -> Element { - cx.render(rsx!(Demo {})) -} - -fn Demo(cx: Scope) -> Element { - let fut1 = use_future(&cx, (), |_| async move { - std::thread::sleep(std::time::Duration::from_millis(100)); - 10 - }); - - cx.render(match fut1.value() { - Some(value) => { - let content = format!("content : {:?}", value); - rsx!(div{ "{content}" }) - } - None => rsx!(div{"computing!"}), - }) -}