mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-02-17 03:50:55 +03:00
20 lines
438 B
JavaScript
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),
|
|
};
|
|
}
|