Remove outdated example; Add note on performance benchmark
This commit is contained in:
1 parent
d2c3f98b55
commit
69dd699b99
2 files changed
+6
-30
No files matched your search
+6
-2
@@ -74,8 +74,6 @@ cargo run --example hello_world
|
|||||||
|
|
||||||
[tasks](./tasks.rs) - Continuously run future
|
[tasks](./tasks.rs) - Continuously run future
|
||||||
|
|
||||||
[order](./order.rs)
|
|
||||||
|
|
||||||
### SVG
|
### SVG
|
||||||
|
|
||||||
[svg_basic](./svg_basic.rs)
|
[svg_basic](./svg_basic.rs)
|
||||||
@@ -86,6 +84,12 @@ cargo run --example hello_world
|
|||||||
|
|
||||||
[framework_benchmark](./framework_benchmark.rs) - Renders a huge list
|
[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
|
[heavy_compute](./heavy_compute.rs) - How to deal with expensive operations
|
||||||
|
|
||||||
## Server-side rendering
|
## Server-side rendering
|
||||||
|
|||||||
@@ -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!"}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user