redux-devtools/packages/redux-devtools-chart-monitor/src/reducers.js
Nathan Bierema 10bf7bc084
chore(*): upgrade prettier (#570)
* chore(*): upgrade prettier

* chore(*): upgrade prettier
2020-08-08 16:26:39 -04:00

20 lines
438 B
JavaScript

import { TOGGLE_VISIBILITY } from './actions';
function toggleVisibility(props, state = props.defaultIsVisible, action) {
if (action.type === TOGGLE_VISIBILITY) {
return !state;
}
if (props.defaultIsVisible !== undefined) {
return props.defaultIsVisible;
}
return true;
}
export default function reducer(props, state = {}, action) {
return {
isVisible: toggleVisibility(props, state.isVisible, action),
};
}