Remove push_future, get use_future kinda working again

This commit is contained in:
Jonathan Kelley committed 2024-01-15 19:34:04 -08:00
1 parent 14651a3573
commit a32ae8b112
8 files changed
+49 -60

No files matched your search

+1 -7
View File
@@ -4,9 +4,6 @@
//! This example shows how to encapsulate state in dioxus components with the reducer pattern.
//! This pattern is very useful when a single component can handle many types of input that can
//! be represented by an enum.
//!
//! Currently we don't have a reducer pattern hook. If you'd like to add it,
//! feel free to make a PR.
use dioxus::prelude::*;
@@ -15,7 +12,7 @@ fn main() {
}
fn app() -> Element {
let state = use_signal(PlayerState::new);
let state = use_signal(|| PlayerState { is_playing: false });
rsx!(
div {
@@ -38,9 +35,6 @@ struct PlayerState {
}
impl PlayerState {
fn new() -> Self {
Self { is_playing: false }
}
fn reduce(&mut self, action: PlayerAction) {
match action {
PlayerAction::Pause => self.is_playing = false,