mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-26 22:20:19 +00:00
Remove outdated example; Add note on performance benchmark
This commit is contained in:
parent
d2c3f98b55
commit
69dd699b99
2 changed files with 6 additions and 30 deletions
|
@ -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
|
||||
|
|
|
@ -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!"}),
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue