mod navigation;
mod selection;
mod status_updates;
mod reset;
mod staging;
mod rebase_todo;
mod merge;
mod remote;
mod pr;
mod conflicts;
mod general;
use crate::app::{actions::Action, state::AppState};
pub fn reduce(mut state: AppState, action: &Action) -> Option<AppState> {
if navigation::handle_navigation(&mut state, action) {
return Some(state);
}
if selection::handle_selection(&mut state, action) {
return Some(state);
}
if status_updates::handle_status_updates(&mut state, action) {
return Some(state);
}
if reset::handle_reset(&mut state, action) {
return Some(state);
}
if staging::handle_staging(&mut state, action) {
return Some(state);
}
if rebase_todo::handle(&mut state, action) {
return Some(state);
}
if merge::handle(&mut state, action) {
return Some(state);
}
if remote::handle(&mut state, action) {
return Some(state);
}
if pr::handle(&mut state, action) {
return Some(state);
}
if conflicts::handle(&mut state, action) {
return Some(state);
}
if general::handle(&mut state, action) {
return Some(state);
}
None
}