Chore: some cleanup and documentation

This commit is contained in:
Jonathan Kelley committed 2021-06-10 01:01:53 -04:00
1 parent fe6938ceb3
commit 517d7f1495
39 files changed
+507 -2142

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> },
)
}
```