Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
matthunz authored Nov 30, 2023
1 parent 311103b commit 2bad0f5
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,20 @@ impl View for Counter {

(
format!("High five count: {count}"),
button("Up High").on_click(|| count += 1),
button("Down low").on_click(|| count -= 1),
button("Up High").on_click(move || count += 1),
button("Down low").on_click(move || count -= 1),
)
}
}

fn main() {
concoct::web::run(Counter { initial_value: 0 })

// OR

concoct::webview::run(Counter { initial_value: 0 })
}
```

## Native (Wgpu and WebViews)
```rust
#[derive(PartialEq)]
struct App;

impl View for App {
fn view(&mut self) -> impl IntoView {
("Native text", WebView::new("WebView text"))
}
}

fn main() {
concoct::native::run(App)
}
```

## Installation
This crate currently requires rust nightly.
You can install concoct by running:
You can install concoct for web by running:
```
cargo add concoct --features full
cargo add concoct --features web
```

0 comments on commit 2bad0f5

Please sign in to comment.