TechNote/app/reducers/navigation.jsx
Joey Payne d14eed9965 Add state for navigation
Currently selected navigation item is available under the navigation
variable so that the whole application has access to it.
2016-03-06 11:08:42 -07:00

18 lines
388 B
JavaScript

import { UPDATE_SELECTION } from '../constants/navigation'
const initialState =
{
selection: {
}
}
export default function navigation(state = initialState, action){
switch (action.type) {
case UPDATE_SELECTION:
return Object.assign({}, state, {
selection: action.selection
})
default:
return state
}
}