feat(wasm): execute client handlers without requests
req: client_local/001\nreq: client_local/004\nreq: client_local/005\nreq: client_local/009\nreq: client_local/010\nreq: client_local/014\nreq: v1_release/001
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "hemx-client-local-example"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
hemx = { path = "../../hemx", features = ["client"] }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
hemplate = { path = "../../../hemplate/hemplate" }
|
||||
|
||||
[build-dependencies]
|
||||
hemx-build = { path = "../../hemx-build" }
|
||||
@@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
hemx_build::app()
|
||||
.run()
|
||||
.expect("compile client-local template");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#[hemx::surface]
|
||||
pub mod ui {}
|
||||
|
||||
#[hemx::handler(client)]
|
||||
pub fn increment() -> impl hemx::IntoEffect {
|
||||
ui::client_local::counter_panel.text("updated by Rust/WASM")
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<main data-hemx-root="client_local">
|
||||
<section data-hemx-slot="counter_panel">idle</section>
|
||||
<button type="button" data-hemx-handle="increment" data-hemx-client="increment">Increment locally</button>
|
||||
</main>
|
||||
Reference in New Issue
Block a user