Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coreysnyder/af8d9955d67542f2ca125c1626bbbc28 to your computer and use it in GitHub Desktop.
Save coreysnyder/af8d9955d67542f2ca125c1626bbbc28 to your computer and use it in GitHub Desktop.
export function toggleSidebar(){
return {
type: TOGGLE_SIDE_NAV,
text: "TEST",
}
}
export default function(state = true, action) {
console.log('default state', state, action);
// Why is action.text == undefined ???
switch (action.type) {
case TOGGLE_SIDE_NAV:
return Object.assign({}, state, {
sideNavOpen: !state.sideNavOpen || false
});
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment