Skip to content

Instantly share code, notes, and snippets.

@perjo927
Created September 8, 2020 14:29
Show Gist options
  • Save perjo927/d0fd6c050538feb9e4b8df83ff36107d to your computer and use it in GitHub Desktop.
Save perjo927/d0fd6c050538feb9e4b8df83ff36107d to your computer and use it in GitHub Desktop.
Visibility reducer
import { CONSTS } from "../actions";
const {
actions: { SET_VISIBILITY },
visibilityFilters: { ALL },
} = CONSTS;
export const setVisibility = (state, filter) => filter;
export const visibilityReducer = (state = ALL, action) =>
action.type === SET_VISIBILITY ? setVisibility(state, action.value) : state;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment