feat: beaf up the use_state hook

This commit is contained in:
Jonathan Kelley committed 2021-07-08 09:29:12 -04:00
1 parent 7aec40d57e
commit e4cdb645aa
11 files changed
+214 -218

No files matched your search

+4 -2
View File
@@ -4,10 +4,12 @@
//! This pattern is very useful when a single component can handle many types of input that can
//! be represented by an enum.
fn main() {}
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch(App, |c| c);
}
pub static ExampleReducer: FC<()> = |cx| {
pub static App: FC<()> = |cx| {
let (state, reduce) = use_reducer(cx, PlayerState::new, PlayerState::reduce);
let is_playing = state.is_playing();