public static VotePageState VoteReducer(VotePageState preVotePageState, VoteAction action) { preVotePageState.Items.Remove(action.Item); preVotePageState.CurrentItem = preVotePageState.NextItem; preVotePageState.NextItem = preVotePageState.Items.SingleOrDefault(); return(preVotePageState); }
public static VotePageState ReduceVotePageState(VotePageState preVotePageState, IAction action) { if (action is VoteAction) { return(VoteReducer(preVotePageState, (VoteAction)action)); } return(preVotePageState); }