This commit is contained in:
parent
9ce8e13a41
commit
c10606e80e
|
@ -2,18 +2,19 @@ use yew::prelude::*;
|
|||
|
||||
#[function_component]
|
||||
fn App() -> Html {
|
||||
let counter = use_state(|| 0);
|
||||
let counter = use_state(|| 283870);
|
||||
let onclick = {
|
||||
let counter = counter.clone();
|
||||
move |_| {
|
||||
let value = *counter + 1;
|
||||
let value = (*counter * 989_909) % 1_212_149;
|
||||
counter.set(value);
|
||||
}
|
||||
};
|
||||
|
||||
html! {
|
||||
<div>
|
||||
<button {onclick}>{ "+1" }</button>
|
||||
<h3>{ "Pseudo Random Generator" }</h3>
|
||||
<button {onclick}>{ "next" }</button>
|
||||
<p>{ *counter }</p>
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue