import * as types from '../../types' import { session, getDefault, getDefaultInt } from '../../session' import { crudState, crudReducer } from '../../api/crud.reducer' const initialState = { timeline: { start_ts: 0, zoom: 0, duration: 0, }, options: { } } export default function alignReducer(state = initialState, action) { // console.log(action.type, action) switch (action.type) { case types.peaks.loaded: return { ...state, timeline: { ...state.timeline, duration: action.data.length / 2, } } case types.align.set_display_setting: return { ...state, timeline: { ...state.timeline, [action.key]: action.value, } } default: return state } }