Feat: shorten readme

This commit is contained in:
Jonathan Kelley committed 2021-02-16 01:41:41 -05:00
1 parent 4b4ea1a09c
commit cc882932e1
5 files changed
+91 -88

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
## Liveview
With the Context, Subscription, and Asynchronous APIs, we've built Dioxus Liveview: a coupling of frontend and backend to deliver user experiences that do not require dedicated API development. Instead of building and maintaining frontend-specific API endpoints, components can directly access databases, server caches, and other services directly from the component.
These set of features are still experimental. Currently, we're still working on making these components more ergonomic
```rust
fn live_component(ctx: &Context<()>) -> VNode {
use_live_component(
ctx,
// Rendered via the client
#[cfg(target_arch = "wasm32")]
|| html! { <div> {"Loading data from server..."} </div> },
// Renderered on the server
#[cfg(not(target_arch = "wasm32"))]
|| html! { <div> {"Server Data Loaded!"} </div> },
)
}
```