nexshop-web-contents
Version:
Nexshop Web Contents Project
18 lines (15 loc) • 489 B
JavaScript
import {OPEN_FLOATING_VIEW, CLOSE_FLOATING_VIEW} from "../action/floating-view";
const initialState = {
visibility: false,
};
export function floatingView(state = initialState, action) {
const {type} = action;
switch (type) {
case OPEN_FLOATING_VIEW:
return Object.assign({}, state, {visibility: true});
case CLOSE_FLOATING_VIEW:
return Object.assign({}, state, {visibility: false});
default:
return state;
}
}