mirror of
https://github.com/wassname/talk.git
synced 2026-06-28 20:41:01 +08:00
23 lines
362 B
JavaScript
23 lines
362 B
JavaScript
import {OPEN_MENU, CLOSE_MENU} from './constants';
|
|
|
|
const initialState = {
|
|
open: false
|
|
};
|
|
|
|
export default function reducer(state = initialState, action) {
|
|
switch (action.type) {
|
|
case OPEN_MENU:
|
|
return {
|
|
...state,
|
|
open: true
|
|
};
|
|
case CLOSE_MENU:
|
|
return {
|
|
...state,
|
|
open: false
|
|
};
|
|
default :
|
|
return state;
|
|
}
|
|
}
|