fn reduce(&self, a: Actions) -> Option<Rc<Counter>> {
        // Reducers take actions and return an Option::Some if there's a new state
        match a {
            Actions::Increment => Some(Rc::new(Counter {
                count: self.count + 1,
            })),
            Actions::Decrement => Some(Rc::new(Counter {
                count: self.count - 1,
            })),
        }
    }
// A Reducer processes an action and returns a new state
A Reducer processes an action and returns a new state
A Reducer processes an action and returns a new state
fn reduce(&self, a: Actions) -> Option<Rc<Counter>> {
        // Reducers take actions and return an Option::Some if there's a new state
        match a {
            Actions::Increment => Some(Rc::new(Counter {
                count: self.count + 1,
            })),
            Actions::Decrement => Some(Rc::new(Counter {
                count: self.count - 1,
            })),
        }
    }
fn reduce ( & self , a : Actions ) -> Option < Rc < Counter > > { // Reducers take actions and return an Option::Some if there's a new state match a { Actions :: Increment => Some ( Rc :: new ( Counter { count : self . count + 1 , } ) ) , Actions :: Decrement => Some ( Rc :: new ( Counter { count : self . count - 1 , } ) ) , } }
A Reducer processes an action and returns a new state
A Reducer processes an action and returns a new state
&self
a
Actions
&self
a
Actions