mod navigation;
mod log_menu;
mod input;
mod rebase;
use crate::app::{actions::Action, state::AppState};
pub fn reduce(state: AppState, action: &Action) -> Option<AppState> {
if let Some(new_state) = navigation::handle_navigation(state.clone(), action) {
return Some(new_state);
}
if let Some(new_state) = log_menu::handle_log_menu(state.clone(), action) {
return Some(new_state);
}
if let Some(new_state) = input::handle_input(state.clone(), action) {
return Some(new_state);
}
if let Some(new_state) = rebase::handle_rebase(state.clone(), action) {
return Some(new_state);
}
None
}