intendednull/yewdux
Fork: 30 Star: 325 (更新于 2025-01-11 11:05:05)
license: Apache-2.0
Language: Rust .
Ergonomic state management for Yew applications
最后发布版本: v0.10.0 ( 2023-12-19 10:56:46)
Yewdux
Ergonomic state management for Yew applications.
See the book for more details.
Example
use yew::prelude::*;
use yewdux::prelude::*;
#[derive(Default, Clone, PartialEq, Store)]
struct State {
count: u32,
}
#[function_component]
fn ViewCount() -> Html {
let (state, _) = use_store::<State>();
html!(state.count)
}
#[function_component]
fn IncrementCount() -> Html {
let (_, dispatch) = use_store::<State>();
let onclick = dispatch.reduce_mut_callback(|counter| counter.count += 1);
html! {
<button {onclick}>{"+1"}</button>
}
}
#[function_component]
fn App() -> Html {
html! {
<>
<ViewCount />
<IncrementCount />
</>
}
}
fn main() {
yew::Renderer::<App>::new().render();
}
最近版本更新:(数据更新于 2024-10-01 12:45:15)
2023-12-19 10:56:46 v0.10.0
2023-10-10 18:01:12 v0.9.4
2023-06-01 14:23:41 v0.9.3
2023-02-23 08:31:13 v0.9.2
2023-02-22 19:52:16 v0.9.1
2022-11-26 05:47:40 v0.9.0
2022-11-01 15:33:25 v0.8.3
2022-09-07 17:33:17 v0.8.2
2022-08-19 10:31:23 v0.8.1
2022-08-19 09:19:22 v0.8.0
主题(topics):
rust, state, state-container, state-management, store, wasm, web, yew
intendednull/yewdux同语言 Rust最近更新仓库
2025-01-18 17:40:38 tauri-apps/tauri
2025-01-18 10:45:18 unionlabs/union
2025-01-18 08:48:25 lapce/lapce
2025-01-17 13:52:59 AppFlowy-IO/AppFlowy-Cloud
2025-01-16 19:13:50 dashpay/platform
2025-01-14 09:40:22 EasyTier/EasyTier