import * as types from 'app/types' const initialState = { transcript: false, checklist: false, nav: false, sections: { loading: true }, options: { } } export default function viewerReducer(state = initialState, action) { // console.log(action.type, action) switch (action.type) { case types.viewer.load_sections: return { ...state, sections: action.data, } case types.viewer.toggle_section: return { ...state, [action.key]: action.value, } default: return state } }