You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
501 B
22 lines
501 B
import { Reducer } from 'redux'
|
|
|
|
import { MenuActions } from '../actions/menu'
|
|
import { MenuState } from '../types'
|
|
|
|
const initialState: MenuState = {
|
|
collapsed: false,
|
|
}
|
|
|
|
const reducer: Reducer<MenuState, MenuActions> = (state = initialState, action) => {
|
|
switch (action.type) {
|
|
case 'MENU_SET_COLLAPSED':
|
|
return {
|
|
...state,
|
|
collapsed: action.payload,
|
|
}
|
|
default:
|
|
return state
|
|
}
|
|
}
|
|
|
|
export default reducer
|