mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 22:01:13 +08:00
23 lines
390 B
JavaScript
23 lines
390 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;
|
|
}
|
|
}
|