Currently selected navigation item is available under the navigation variable so that the whole application has access to it.
18 lines
388 B
JavaScript
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
|
|
}
|
|
}
|