<commit_before>import { TOGGLE_NAV, OPEN_NAV, CLOSE_NAV, CHANGE_NAV } from '../actions/navigation';

const initialState = {
  open: false,
};

export default function navigation(state = initialState, action) {
  switch (action.type) {
    case TOGGLE_NAV:
      return Object.assign({}, state, {
        open: !state.open,
      });
    case OPEN_NAV:
      return Object.assign({}, state, {
        open: true,
      });
    case CHANGE_NAV:
      return Object.assign({}, state, {
        open: action.open,
      });
    case CLOSE_NAV:
      return Object.assign({}, state, {
        open: false,
      });
    default:
      return state;
  }
}

export const getNavStatus = (state) =>
  state.navigation.open;<commit_msg>decompose navigation reducer<commit_after>import { combineReducers } from 'redux';
import { TOGGLE_NAV, OPEN_NAV, CLOSE_NAV, CHANGE_NAV } from '../actions/navigation';

const navigation = () => {
  const isOpen = (state = false, action) => {
    switch (action.type) {
      case TOGGLE_NAV:
        return !state;
      case OPEN_NAV:
        return true;
      case CHANGE_NAV:
        return action.open;
      case CLOSE_NAV:
        return false;
      default:
        return state;
    }
  };

  return combineReducers({
    isOpen,
  });
};

export default navigation;

export const getNavStatus = (state) =>
  state.isOpen;
{'fraction_non_alphanumeric': 0.12223858615611193, 'fraction_numerical': 0.0, 'mean_word_length': 2.5952380952380953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5274783', 'n_tokens_mistral': 455, 'n_tokens_neox': 444, 'n_words': 106}