Skip to content

Commit

Permalink
Fixed mixin example
Browse files Browse the repository at this point in the history
  • Loading branch information
geofmureithi committed Oct 1, 2022
1 parent 7032e03 commit 7ece186
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ fn counter(app: &HirolaApp) -> Dom {
let count = Signal::new(0);
let increment = count.mut_callback(|c, _| c + 1)
html! {
<>
<div>
<button on:click=increment>"Increment"</button>
<span>{count.get()}</span>
</>

</div>
}
}
fn main() {
Expand Down
1 change: 1 addition & 0 deletions crates/hirola-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ version = "0.3"
criterion = {version = "0.3", features = ["html_reports"]}
wasm-bindgen-test = "0.3"
hirola = { path ="../../" }
web-sys = { version = "0.3", features =["DomTokenList", "Element", "Window"]}

[features]
default = ["dom", "wasm-bindgen", "web-sys"]
Expand Down
8 changes: 6 additions & 2 deletions crates/hirola-core/src/mixins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@
//! }
//! }
//! fn main() {
//! let app = HirolaApp::new();
//! app.mount("body", mixin_demo);
//! let window = web_sys::window().unwrap();
//! let document = window.document().unwrap();
//! let body = document.body().unwrap();
//! let app = HirolaApp::new();
//!
//! app.mount(&body, mixin_demo);
//! }
//! ```
use std::{
Expand Down

0 comments on commit 7ece186

Please sign in to comment.