use super::{actions::Action, state::AppState};
use crate::app::reducers;
pub fn reducer(state: AppState, action: Action) -> AppState {
if let Some(state) = reducers::ui_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::status::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::diff_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::branch_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::commit_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::stash_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::tag_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::reflog_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::palette_reducer::reduce(state.clone(), &action) { return state; }
if let Some(state) = reducers::async_reducer::reduce(state.clone(), &action) { return state; }
match action {
Action::StageSelectedFile
| Action::UnstageSelectedFile
| Action::StageAllFiles
| Action::UnstageAllFiles
| Action::CommitSubmit
| Action::AmendCommit
| Action::Push
| Action::CherryPickSelected
| Action::RevertSelected
| Action::RebaseContinue
| Action::RebaseAbort
| Action::ResetHard
| Action::ResetMixed
| Action::ResetSoft
| Action::RequestResetHard
| Action::RequestResetMixed
| Action::RequestResetSoft
| Action::CancelReset
| Action::StageCurrentHunk
| Action::UnstageCurrentHunk
| Action::StageSelectedLines
| Action::UnstageSelectedLines
| Action::RefreshBranches
| Action::CheckoutBranch(_)
| Action::CheckoutRemoteBranch(_)
| Action::DeleteBranch(_)
| Action::MergeBranch(_)
| Action::RebaseBranch(_)
| Action::RefreshStatus
| Action::RequestRefreshStatus
| Action::RefreshCommits
| Action::ShowCommitDetail(_)
| Action::CherryPickCommit(_)
| Action::RevertCommit(_)
| Action::RefreshStashes
| Action::ApplyStash(_)
| Action::PopStash(_)
| Action::RefreshTags
| Action::CheckoutTag(_)
| Action::DeleteTag(_)
| Action::RefreshReflog
| Action::CheckoutReflog(_)
| Action::BranchSubmit => state,
_ => state,
}
}