All files / nexshop-web-contents/src/reducer floating-view.js

100% Statements 7/7
100% Branches 4/4
100% Functions 1/1
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x   1x         4x   4x   2x   1x   1x    
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;
    }
}