Bladeren bron

Remove outdated example; Add note on performance benchmark

Reinis Mazeiks 3 jaren geleden
bovenliggende
commit
69dd699b99
2 gewijzigde bestanden met toevoegingen van 6 en 30 verwijderingen
  1. 6 2
      examples/README.md
  2. 0 28
      examples/order.rs

+ 6 - 2
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

+ 0 - 28
examples/order.rs

@@ -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!"}),
-    })
-}